允许SharePoint Webpart写入文件系统

时间:2014-05-29 19:52:47

标签: sharepoint sharepoint-2010

所以我一直在拼命想让我的SharePoint项目将xml文件写入项目目录中的临时位置,但是没有取得任何成功。

当我尝试:

myDataTable.WriteXml("path to folder in project", true);

我见过:

"Access to path is Denied"

现在我之前遇到过这个问题并且已经通过giving the user group for the application pool write permissions解决了这个问题,但它对我的sharepoint项目并没有起作用。有什么建议吗?

1 个答案:

答案 0 :(得分:2)

在调用此方法之前,您可能需要提升代码中的权限。查看spsecurity.runwithelevatedprivileges方法以将代码作为Sharepoint Web应用程序池帐户运行。然后,您需要为该帐户授予对文件系统的正确权限。

相关问题