简体   繁体   English

如何以编程方式在Sharepoint站点上创建文件夹

[英]How to programatically create a folder at a Sharepoint site

this question is related with this one . 这个问题与有关这一个 How can I create a folder to put the files I upload inside them without using the SharePoint API (I'm executing the application on another host)? 如何创建一个文件夹,以在不使用SharePoint API的情况下将我上传的文件放入其中(我正在另一台主机上执行该应用程序)?

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. 因此,您也可以查看breakroleinheritence属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何以编程方式从sharepoint站点下载文件? - How do I programatically download a file from a sharepoint site? 在 C# 中,如果 SharePoint 网站上不存在文件夹,如何创建该文件夹 - In C#, how can I create a folder if it does not exist on a SharePoint site 如何使用Sharepoint Web服务创建网站? - How to Create Site using Sharepoint web services? SharePoint 2007-如何以编程方式创建网站模板 - SharePoint 2007 - How to create a site template programmatically 如何使用C#以编程方式创建共享点导航栏 - How to create sharepoint navigation bar programatically using c# 无法在Sharepoint中以编程方式访问共享文件夹 - Cannot access shared folder programatically in sharepoint 如何使用 C# 将 SharePoint 站点文件夹映射为网络驱动器? - How to map SharePoint site folder as network drive using C#? 如何使用C#以编程方式从SharePoint网站获取所有图片库的列表 - How to get list of all picture libraries from SharePoint site programatically using C# 在SharePoint 2007中使用C#以编程方式创建页面 - Create a page programatically with C# in SharePoint 2007 如何为SharePoint网站中的任何更改创建每日摘要警报 - How to create a daily summary alert for any change in a SharePoint site
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM