简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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