【发布时间】:2019-12-19 20:38:22
【问题描述】:
将文件从一个服务器路径复制到另一个显示访问被拒绝,尽管我已授予完全访问权限。
Error:System.UnauthorizedAccessException: 访问路径是 否认。在 System.IO.__Error.WinIOError(Int32 错误代码,字符串 MaybeFullPath) 在 System.IO.File.InternalMove(String sourceFileName, String destFileName, Boolean checkHost)
我已尝试授予对所需文件夹的安全访问权限
string sourceFile = "C:/inetpub/wwwroot/MATS_History_Load_App/Python_Scripts/MATSUpgrade.xlsx";
string destinationFile = "//192.xxx.47/Mats/mats_test/MATSUpgrade.xlsx";
// To move a file or folder to a new location:
System.IO.File.Move(sourceFile, destinationFile);
重要提示:应用程序托管在 IIS 上
【问题讨论】:
-
请在问题中添加一些帮助信息,例如托管环境!
标签: c# asp.net-mvc iis