简体   繁体   English

UnauthorizedAccessException。 无法写入服务器C#

[英]UnauthorizedAccessException. Can't write to server c#

I have ac# program that attempts to create a pdf on a web server. 我有一个ac#程序,试图在Web服务器上创建pdf。 I have the correct permissions but it keeps throwing an exception 我拥有正确的权限,但始终会引发异常

 PdfWriter.GetInstance(document, new FileStream("//share/Document" + "/TestDoc.pdf", FileMode.Create));

I get an unauthorizedAccessException, and dont know how to proceed 我收到未授权的AccessException,并且不知道如何进行

Go to Advanced Settings on the AppPool and scroll down until you find "Identity." 转到AppPool上的“高级设置”并向下滚动,直到找到“身份”。 That's the user that needs permissions. 那是需要权限的用户。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM