我必须阅读下面给定的xml文件......... [英] i have to read this given below file in xml............

查看:63
本文介绍了我必须阅读下面给定的xml文件.........的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以帮助我olz紧急...........

该文件的路径是...........
C:\ Documents and Settings \ azhar \ Desktop \ appsettings.xml


any one help me olz urgent...........

path of this file is...........
C:\Documents and Settings\azhar\Desktop\appsettings.xml


<?xml version="1.0" standalone="yes" ?>
- <DocumentElement>
- <Location>
  <id>NMBM Test</id>
  <DataBaseName>ICMAStest</DataBaseName>
  <WebServerName>ICMAS-TEST</WebServerName>
  <DataBaseServerName>ICMAS-TEST\SQLEXPRESS</DataBaseServerName>
  <ClientSettingsProvider.ServiceUri />
  <RptUrl>http://icmas-test/ReportServer_SQLEXPRESS</RptUrl>
  <ReportPath>/ICMASReports/</ReportPath>
  <ReportServerUserName>NALIN</ReportServerUserName>
  <ReportServerPassword>temp123</ReportServerPassword>
  <SMTPServerId>10.100.0.80</SMTPServerId>
  </Location>
- <Location>
  <id>NMBM Production</id>
  <DataBaseName>ICMAStest</DataBaseName>
  <WebServerName>ICMAS-TEST</WebServerName>
  <DataBaseServerName>ICMAS-TEST\SQLEXPRESS</DataBaseServerName>
  <ClientSettingsProvider.ServiceUri />
  <RptUrl>http://icmas-test/ReportServer_SQLEXPRESS</RptUrl>
  <ReportPath>/ICMASReports/</ReportPath>
  <ReportServerUserName>NALIN</ReportServerUserName>
  <ReportServerPassword>temp123</ReportServerPassword>
  <SMTPServerId>10.100.0.80</SMTPServerId>
  </Location>
- <Location>
  <id>ICMASDev Satish</id>
  <DataBaseName>ICMAStest</DataBaseName>
  <WebServerName>192.168.0.178</WebServerName>
  <DataBaseServerName>epmpune\ciodevdb</DataBaseServerName>
  <ClientSettingsProvider.ServiceUri />
  <RptUrl>http://icmas-test/ReportServer_SQLEXPRESS</RptUrl>
  <ReportPath>/ICMASReports/</ReportPath>
  <ReportServerUserName>NALIN</ReportServerUserName>
  <ReportServerPassword>temp123</ReportServerPassword>
  <SMTPServerId>10.100.0.80</SMTPServerId>
  </Location>
- <Location>
  <id>ICMAS Test icmastest-userpc2</id>
  <DataBaseName>ICMASQA</DataBaseName>
  <WebServerName>userpc2</WebServerName>
  <DataBaseServerName>epmpune\ciodevdb</DataBaseServerName>
  <ClientSettingsProvider.ServiceUri />
  <RptUrl>http://userpc2/ReportServer_SQLEXPRESS</RptUrl>
  <ReportPath>/userpc2/</ReportPath>
  <ReportServerUserName>NALIN</ReportServerUserName>
  <ReportServerPassword>temp123</ReportServerPassword>
  <SMTPServerId>mail.24by7cio.com</SMTPServerId>
  </Location>
- <Location>
  <id>ICMASQA</id>
  <DataBaseName>ICMASQA</DataBaseName>
  <WebServerName>192.168.0.178</WebServerName>
  <DataBaseServerName>epmpune\ciodevdb</DataBaseServerName>
  <ClientSettingsProvider.ServiceUri />
  <RptUrl>http://userpc2/ReportServer_SQLEXPRESS</RptUrl>
  <ReportPath>/userpc2/</ReportPath>
  <ReportServerUserName>NALIN</ReportServerUserName>
  <ReportServerPassword>temp123</ReportServerPassword>
  <SMTPServerId>mail.24by7cio.com</SMTPServerId>
  </Location>
  </DocumentElement>

推荐答案

您的文件应如下所示.我从中删除-",然后从asp dot net加载xml,我获得了成功.我完成了如下代码.

your file should be like as below. i remove "-" from it and then i load xml from asp dot net i got the success. i done code as below.

XmlDocument xDoc = new XmlDocument();
xDoc.Load(@"<your path="" here="">");
</your>



您的Xml应该是



Your Xml Should be

<documentelement>
<location>
  <id>NMBM Test</id>
  <databasename>ICMAStest</databasename>
  <webservername>ICMAS-TEST</webservername>
  <databaseservername>ICMAS-TEST\SQLEXPRESS</databaseservername>
  <clientsettingsprovider.serviceuri />
  <rpturl>http://icmas-test/ReportServer_SQLEXPRESS</rpturl>
  <reportpath>/ICMASReports/</reportpath>
  <reportserverusername>NALIN</reportserverusername>
  <reportserverpassword>temp123</reportserverpassword>
  <smtpserverid>10.100.0.80</smtpserverid>
</location>
<location>
  <id>NMBM Production</id>
  <databasename>ICMAStest</databasename>
  <webservername>ICMAS-TEST</webservername>
  <databaseservername>ICMAS-TEST\SQLEXPRESS</databaseservername>
  <clientsettingsprovider.serviceuri />
  <rpturl>http://icmas-test/ReportServer_SQLEXPRESS</rpturl>
  <reportpath>/ICMASReports/</reportpath>
  <reportserverusername>NALIN</reportserverusername>
  <reportserverpassword>temp123</reportserverpassword>
  <smtpserverid>10.100.0.80</smtpserverid>
</location>
</documentelement>


尝试一下..
Try this..
XmlDocument xDoc = new XmlDocument();
xDoc.Load("YourFilePath");



一切顺利.



All the best..


这篇关于我必须阅读下面给定的xml文件.........的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆