XmlDocument.Load(url) 本地和http远程

网友投稿 544 2022-09-26

XmlDocument.Load(url) 本地和http远程

XmlDocument.Load(url) 本地和http远程

XmlDocument.Load(url) 的使用

远程:

string path = @"​​doc = new XmlDocument(); doc.Load(path); XmlNode = doc.SelectSingleNode("configuration");

本地:

如果是 xml 本地文件,转换起来比较方便,可以采用这种方法

string path = AppDomain.CurrentDomain.BaseDirectory; path = Path.Combine(path, "XMLConfig.xml"); XmlDocument doc = new XmlDocument();//path = @" doc.Load(path); XmlNode = doc.SelectSingleNode("configuration"); XmlNodeList = doc = new XmlDocument();doc.LoadXml(new WebClient().DownloadString(@"​​= doc.SelectSingleNode("configuration");XmlNodeList = httpservice.ChildNodes;

龙腾一族至尊龙骑

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:重学前端 39 # CSS的动画和交互
下一篇:XmlDocument.Load(url) url是https远程时,报错
相关文章

 发表评论

暂时没有评论,来抢沙发吧~