开发者

How to programatically create a folder at a Sharepoint site

开发者 https://www.devze.com 2023-01-31 09:40 出处:网络
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)

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消