WorldofASP.NET : ASP.NET Directory, Tutorial, Hosting, and Source Code
You are 1 of 124 users


SharePoint 2007: Accessing information on the SharePoint Web Server Extensions folder

Blogger : ASP.NET Blogs
All posts : All posts by ASP.NET Blogs
Category : SharePoint
Blogged date : 2006 Nov 11

Information on SharePoint and the path where it manages its information can be found in the registry. For example the registry entry SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\Location contains the path to the Web Server Extensions folder for SharePoint 2007, and SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\Version contains the current version of SharePoint 2007. Yes I know, RTM is out, and I'm still running on Beta 2 TR:-(

 

I came accross the following code by Microsoft for getting the Features folder:

 

        private string GetSharePointFeaturesDirectory()
        {
            string key = @"SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0";
            string name = "Location";

            string featuresDir = String.Empty;
            try
            {
                RegistryKey regKey = Registry.LocalMachine.OpenSubKey(key);
                string value = regKey.GetValue(name) as string;
                regKey.Close();

                featuresDir = Path.Combine(value, @"template\features");
            }
            catch (SecurityException)
            {
                featuresDir = String.Empty;
            }
            catch (ArgumentNullException)
            {
                featuresDir = String.Empty;
            }
            catch (ArgumentException)
            {
                featuresDir = String.Empty;
            }
            catch (ObjectDisposedException)
            {
                featuresDir = String.Empty;
            }
            catch (IOException)
            {
                featuresDir = String.Empty;
            }
            catch (UnauthorizedAccessException)
            {
                featuresDir = String.Empty;
            }

            return featuresDir;
        }
Share this post: Email it! | bookmark it! | digg it! | reddit!

Read comments or post a reply to : SharePoint 2007: Accessing information on the SharePoint Web Server Extensions folder
Page 1562 of 1924
Next | Last

.NET News Categories








Legend : - Within 3 Days - Within 6 Days - Within 9 Days

Home | Add Resources | Sponsored Listings | Advertise with Us | SiteMap 1 | SiteMap 2 | Link To Us | Contact Us
© 2002-2008 Worldofasp.net ASP.NET Directory, Hosting and Tutorials | All rights reserved
Our Partners : ASP.NET Web Hosting | Windows Web Hosting | ASP.NET Hosting | Phone Card | PHP Directory | Bangkok Hotels |Calling Card