this question is related with this one. How can I create a fo开发者_JAVA百科lder to put the files I upload inside them without using the SharePoint API (I'm executing the application on another host)?
Thanks in advance.
SPSite _MySite = new SPSite("http://adfsaccount:2222/");
SPWeb _MyWeb = _MySite.OpenWeb();
SPDocumentLibrary _MyDocLibrary = (SPDocumentLibrary) _MyWeb.Lists["My Documents"];
SPFolderCollection _MyFolders = _MyWeb.Folders;
_MyFolders.Add("http://adfsaccount:2222/My%20Documents/" + txtUpload.Text + "/");
_MyDocLibrary.Update();
_MyWeb.Dispose();
_MySite .Dispose();
I created console application to create folders. I need to give seperate permissions for each and every folder because those are all state folders. So you can look at the breakroleinheritence property also.
精彩评论