简体   繁体   English

从远程机器访问XML文件

[英]Accessing XML file from remote machine

I want to access xml file from remote machiene say "a.abc.int" I am using following code to do this 我想从远程机器访问xml文件,说“ a.abc.int”,我正在使用以下代码来做到这一点

string reportPath = @"\\a.abc.int\c$\Program Files\abc\File.xml";
XmlDocument reportParameter = new XmlDocument();
reportParameter.Load(reportPath);
XmlElement reportParameterReader = reportParameter.DocumentElement;

but I get an exception at 但我有一个例外

reportParameter.Load(reportPath); 
retrun exception {System.UnauthorizedAccessException}

If the machines are part of the same domain, you can impersonate your code with a user of the Domain who have right. 如果这些计算机属于同一域,则可以使用具有权限的域用户模拟代码。 (Try Domain/Administrator) if it work problem is clearly sharing right problem. (尝试使用Domain / Administrator),如果它正常工作是共享权利问题。

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

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