I realise this is a silly question but the MSDN can’t be accessed from my network "Server Error: 502 - Web server received an invalid response while acting as a gateway or proxy server." and I can’t just sit here and twiddle my thumbs.
I know of no alternative to the MSDN, and my local Visual Studio help thing doesn’t have anything on this class.
Please could someone copy and paste the entries for Microsoft.Sharepoint SPSite class, specifically the Constructor but the whole article would be useful.
I am getting a FileNotFoundException and need to know how the URL property is supposed to be formatted.
In case any of you just happen to know.
public Dictionary<string, SPFolder> GetFolderCollection(string siteURL, string docLibraryName)
{
using (SPSite oSite = new SPSite(siteURL + ":23179"))
{
SPWeb oWeb = oSite.OpenWeb();
SPList oList = oWeb.Lists[docLibraryName];
SPFolderCollection oFolders = oList.RootFolder.SubFolders;
foreach (SPFolder folder in oFolders)
{
foundFolders.Add(folder.Name, folder);
}
return foundFolders;
}
}
Edit: Cheers, google cache ftw.
For the record I was pointing to the IIS site root, not the Sharepoint “Site”. Was confusing the Sharepoint terminology.
Constructors: