[英]Unable to write PDF to disk. Windows error 5. Access is denied
我使用AbcPdf,..生成pdf后,我想将其保存到某个文件夹中,例如“ generatedPdf”
string path = "C:\\project-name\\wwwroot\\generatedPdf\\";
try{
theDoc.Save(path);
theDoc.Clear();
}
catch (Exception ex)
{
throw new Exception(ex.ToString());
}
错误消息是:
无法将PDF写入磁盘。 Windows错误5。访问被拒绝。
我为此文件夹设置IISUser和SystemUser的权限=>完全控制
我做错了什么?
您必须提供一个文件名:
string path = "C:\\project-name\\wwwroot\\generatedPdf\\somefile.pdf";
^^^^^^^^^^^^
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.