我正在尝试在网络共享驱动器上创建一个文件并不断提出相同的错误
Event Log Error
Event code: 4011
Event message: An unhandled access exception has occurred.
Event time: 9/15/2014 3:42:45 PM
Event time (UTC): 9/15/2014 7:42:45 PM
Event ID: c502025e2cb2a987asfas98as987732
Event sequence: 14
Event occurrence: 1
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/1/ROOT-1-130552837386928589
Trust level: Full
Application Virtual Path: /
Application Path: D:\Sites\website\
Machine name: ComputerName01
Process information:
Process ID: 1732
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE
Request information:
Request URL: http://website.com/requestedURL
Request path: /requestedURL
User host address: 25.33.33.23
User: CORP\SomeUser
Is authenticated: True
Authentication Type: Negotiate
Thread account name: NT AUTHORITY\NETWORK SERVICE
Custom event details:
事件日志我将受保护的信息(如IP地址和URL等)更改为false值以保护我的数据。
下面是我一直在使用的代码,我已经查看了谷歌和这里,我发现了类似的问题,但从长远来看,问题不一样。我假设我必须冒充NT AUTHORITY \ NETWORK SERVICE,但我很遗憾如何这样做。 此外,我不认为这是一个太大的交易,但我在一个双服务器的网络农场
哦,我尝试使用k:\的映射映射驱动器,但仍然会出现相同的错误
using (FileStream file = new FileStream(@"\\SharedDrive\PDF\SomeFileName.pdf", FileMode.OpenOrCreate, System.IO.FileAccess.ReadWrite))
{
byte[] bytes = new byte[stream.Length];
stream.Read(bytes, 0, (int)stream.Length);
file.Write(bytes, 0, bytes.Length);
stream.Close();
}
编辑: 我已将应用程序更改为使用相同的结果运行我自己的Active Directory登录。 我有权访问该目录,并在该目录中创建和修改文件 错误仍然是