C# 4.0 在sharepoint布局中创建新文件夹
我需要在layouts文件夹中保存一些数据/文件。我的SharePoint项目是“我的项目” 因此,目录结构包括 “C:\Program Files\Common Files\microsoft shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\MyProject” 现在我需要以编程方式创建一个名为“Data”的新文件夹。但我得到“拒绝访问”错误C# 4.0 在sharepoint布局中创建新文件夹,c#-4.0,sharepoint,C# 4.0,Sharepoint,我需要在layouts文件夹中保存一些数据/文件。我的SharePoint项目是“我的项目” 因此,目录结构包括 “C:\Program Files\Common Files\microsoft shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\MyProject” 现在我需要以编程方式创建一个名为“Data”的新文件夹。但我得到“拒绝访问”错误 有人能告诉我为什么我被拒绝访问吗?即使我已将代码包装在RunWithElevatedPrivilege
有人能告诉我为什么我被拒绝访问吗?即使我已将代码包装在RunWithElevatedPrivileges中?我也尝试过您编写的代码,并且运行良好 应该有窗口文件夹安全设置。在我的文件夹中,我有下一个具有读/写权限的用户:
SPSecurity.RunWithElevatedPrivileges(delegate
{
String path = SPUtility.GetGenericSetupPath(String.Empty) + "TEMPLATE\\LAYOUTS\\MyProject\\Data";
bool IsExists = System.IO.Directory.Exists(path);
if (!IsExists)
System.IO.Directory.CreateDirectory(path);// Access denied!
});