读取xml到DataSet中去
XML如下:
<?xml version="1.0" encoding="utf-8" ?> <Config><System><BaseServer Name="SSO" Title="单点登录" Server="http://10.254.2.22:9010/"></BaseServer><BaseServer Name="TICKET" Title="凭证服务" Server="http://10.254.2.22:9980/"></BaseServer></System><Components><Component Name="mxsbcztdsys" DependComponent="" IntegrationType="SSO" Assembly="Hlwdsj.Mxsb.Cztdsys.dll" Interface="Hlwdsj.Mxsb.Cztdsys.CztdsysFunction" TileConfigFile="" Title="明细申报-城镇土地使用税" Server="http://10.254.2.169:8080/"/><Component Name="mxsbZys" DependComponent="" IntegrationType="SSO" Assembly="Hlwdsj.Mxsb.ZYS.dll" Interface="Hlwdsj.Mxsb.ZYS.ZYSFunction" TileConfigFile="" Title="明细申报-资源税" Server="http://10.254.2.42:9000/"/><Component Name="qysdsjb" DependComponent="" IntegrationType="SSO" Assembly="Hlwdsj.QysdsJb.dll" Interface="Hlwdsj.QysdsJb.QysdsJbFunction" TileConfigFile="" Title="企业所得税申报系统" Server="http://10.254.2.86:8080/"/><Component Name="mxsbGrsds" DependComponent="" IntegrationType="SSO" Assembly="Hlwdsj.GrsdsMxsb.dll" Interface="Hlwdsj.GrsdsMxsb.GsMxsbFunction" TileConfigFile="" Title="个税明细申报" Server="http://10.254.2.52:9900/"/><Component Name="mxsbZskp" DependComponent="" IntegrationType="SSO" Assembly="Hlwdsj.Mxsb.Zskp.dll" Interface="Hlwdsj.Mxsb.Zskp.ZskpFunction" TileConfigFile="" Title="征收开票" Server="http://10.254.2.180:8888/"/><Component Name="wtgsdzfjs" DependComponent="" IntegrationType="SSO" Assembly="Hlwdsj.Gt3Wtgsdzfjs.dll" Interface="Hlwdsj.Gt3Wtgsdzfjs.WtgsdzfjsFunction" TileConfigFile="" Title="委托国税代征附加税" Server="http://10.254.2.180:8888/"/><Component Name="kjqysdsbadj" DependComponent="" IntegrationType="SSO" Assembly="Hlwdsj.Gt3Kjqysdsbadj.dll" Interface="Hlwdsj.Gt3Kjqysdsbadj.KjqysdsbadjFunction" TileConfigFile="" Title="报备扣缴企业所得税合同备案登记表" Server="http://10.254.2.180:8888/"/><Component Name="mxsbYhs" DependComponent="" IntegrationType="SSO" Assembly="Hlwdsj.Mxsb.Yhs.dll" Interface="Hlwdsj.Mxsb.Yhs.YhsFunction" TileConfigFile="" Title="明细申报-印花税" Server="http://10.254.2.243:8081/"/><!--<Component Name="mxsbSzdj" DependComponent="" IntegrationType="SSO" Assembly="Hlwdsj.Mxsb.Szdj.dll" Interface="Hlwdsj.Mxsb.Szdj.SzdjFunction" TileConfigFile="" Title="税(费)种认定" Server="http://10.254.2.180:8888/"/>--><Component Name="mxsbTysb" DependComponent="" IntegrationType="SSO" Assembly="Hlwdsj.Tysb.dll" Interface="Hlwdsj.Tysb.TysbFunction" TileConfigFile="" Title="通用申报" Server="http://10.254.2.162:8080/"/><Component Name="ssspbpm" DependComponent="hxzg" IntegrationType="SSO" Assembly="Hlwdsj.Sssp.BPM.dll" Interface="Hlwdsj.Sssp.BPM.BPMFunction" TileConfigFile="" Title="审批事项" Server="http://10.254.2.22:3080/;http://10.254.2.22:9080/;http://10.254.2.22/;10.254.2.230,8888"/><Component Name="gt3sssp" DependComponent="" IntegrationType="DefaultAdd" Assembly="Hlwdsj.Gt3Sssp.dll" Interface="Hlwdsj.Gt3Sssp.SsspGt3Function" TileConfigFile="" Title="审批事项-金三" Server="http://10.254.2.22:3080/"/><Component Name="Zysssp" DependComponent="" IntegrationType="DefaultAdd" Assembly="Hlwdsj.ZySssp.dll" Interface="Hlwdsj.ZySssp.SsspFunction" TileConfigFile="" Title="审批事项事项-自有" Server="http://10.254.2.22:3080/"/><Component Name="WWGL" DependComponent="" IntegrationType="SSO" Assembly="Hlwdsj.Gt3Wwgl.dll" Interface="Hlwdsj.Gt3Wwgl.WwglFunction" TileConfigFile="" Title="外网管理" Server="http://10.254.2.243:8081/"/></Components> </Config>
XML
读取XML代码如下:
SystemTileConfigFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"Config\TileConfig.xml"); if (!File.Exists(SystemComponentConfigFile))throw new Exception(string.Format("系统核心配置文件“{0}”丢失", SystemComponentConfigFile));try{DataSet ds = new DataSet();ds.ReadXml(SystemComponentConfigFile);DataTable dt = ds.Tables["BaseServer"];foreach (DataRow dr in dt.Rows){ssoServer.Add(dr["Name"].ToString(), dr["Server"].ToString());}
C#
转载于:https://www.cnblogs.com/weiweiboqi/p/5663625.html
读取xml到DataSet中去相关推荐
- android的读取xml配置文件,android中XMl文件的读取
废话不多说了直接上代码: 新建一个Xml文件用于读取: test.xml java Eclipse Swift Xcode C# Visual Studio 后台: import android.su ...
- SQL Server中读取XML文件的简单做法
SQL Server 2000使得以XML导出数据变得更加简单,但在SQL Server 2000中导入XML数据并对其进行处理则有些麻烦.本文介绍在SQL Server中读取XML文件的简单做法. ...
- C#中常用的几种读取XML文件的方法
XML文件是一种常用的文件格式,例如WinForm里面的app.config以及Web程序中的web.config文件,还有许多重要的场所都有它的身影.Xml是Internet环境中跨平台的,依赖于内 ...
- C#中读取XML文件方法
C#中读取XML文件方法 XML 简介 格式 c#读取XML文件方法 使用XmlDocument 操作 注意 解决方法: 使用XmlTextReader/XmlTextWriter 操作 使用Linq ...
- 在asp.net中读取XML文件信息的4种方法
方法一 :使用XML控件 <% @ Page Language="C#"%> <html> <body> <h3 ...
- 在C#中使用XML指南之读取XML
对于XML,想必各位都比较了解,我也就不用费笔墨来描述它是什么了,我想在未来的Web开发中XML一定会大放异彩,XML是可扩展标记语言,使用它企业可以制定一套自己的数据格式,数据按照这种格式在网络中传 ...
- C#中读取xml文件指定节点
假设xml文件内容是 <?xml version="1.0" encoding="utf-8"?> <Workflow> <A ...
- 利用opencv中的类FileStorage生成和读取XML和YAML文件
有时候程序中的变量值.字符串.数组等数据也需要独立于源代码本身保存,这个时候就需要用到XML和YAML文件进行保存. OpenCV4提供了用于生成和读取XML文件和YAML文件的类FileStorag ...
- 【原创】数据库中时间字段的值读取到DataSet中后,毫秒部分丢失。
数据库中时间字段的值读取到DataSet中后,毫秒部分丢失. 在网上查了些解决方案,说读取时间时,先转化为DateTime类型,然后在ToString("yyyy-MM-dd HH:mm:s ...
最新文章
- springboot工程添加404页面
- 含有“外骨骼”的电影和游戏
- 逆向链表c语言 abcdef,6-6 求单链表元素序号 (5 分)
- SAP ABAP:获取汇率的完整实现之一
- Eclipse中怎样修改jar包的源码并将原jar包替换
- 你没有看错,爬网页数据,C# 也可以像 Jquery 那样
- CF643F-Bears and Juice【组合数学】
- python3安装后怎么开启_python3.10 如何下载安装?
- 单片机汉字点阵c语言程序,51单片机C语言多种点阵屏驱动程序(开发软件为keil C...
- html%3c arial%3e,【博客园】样式美化+网站统计访问+添加网易云背景音乐
- 结合XML的数据检索技术
- linux 如何访问weblogic console,怎么修改weblogic console登陆的用户名和密码
- 让IE中的IFrame透明
- 下载网络图片并上传微信公众平台素材库
- 白杨SEO:流量红利消失,现在都在各渠道做推广,我们还有必要做官方网站吗?怎么做呢?
- EXCEL数据分析的基本知识
- fontTools库来检测字体文件中是否包含某字符
- 在线房屋收租app开发优势
- 这么久了,深爱的人,还好吗?
- 央视推荐的护眼灯是哪款?分享央视曝光护眼灯品牌
热门文章
- 亚马逊测评的评论为什么老被删?
- SNMP协议控制AP7921设备电源端口
- jquery音乐播放器(歌词滚动版)
- 黑房东!我忍无可忍了,这次一定要你得到法律的制裁
- Web版Skype现面向全球开测,支持中文
- 列表里面有字典[{},{},{},{}],按着字典的指定的key所对应的value值得大小排序
- 2019 ICPC Asia-East Continent Final C Dirichlet k-th root
- 【观察】疫情之下,核心系统架构转型“平衡术”
- 博客 学院 下载 更多 zxy18210943475 java 和 、|| 和 | 的区别和作用
- Linux下的线程池源代码请到下面的链接下载