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#

读取xml到DataSet中去的更多相关文章

  1. 添加节点至XML文档中去

    不管是<怎样创建XML文档> http://www.cnblogs.com/insus/p/3276944.html还是<泛型List<T>转存为XML文档> ht ...

  2. 两个Xml转换为DataSet方法(C#)

    ///通过传入的特定XML字符串,通过 ReadXml函数读取到DataSet中.protected static DataSet GetDataSetByXml(string xmlData){   ...

  3. C#把Xml转换为DataSet的两种方法

    转:https://blog.csdn.net/beyondqd/article/details/6724676 下面给出两个实现XML数据转成DataSet的两个方法. 第1种: //通过传入的特定 ...

  4. 删除XML文档中某节点

    前几天Insus.NET在写了一系列XML文档进行操作.创建 <怎样创建XML文档> http://www.cnblogs.com/insus/p/3276944.html       & ...

  5. 关于如何读取XML文件的一个简单方法

    在平时开发系统功能的时候,我们经常会碰到一些需求需要经常性的发生变化,比如 系统版本.更新日志 等等.这个时候用一个XML文件来替代数据库,就会变的简便很多. 前段时候我也正好需要改个需求,是关于客户 ...

  6. 读取xml数据装配到字典中之应用场景

    前段时间看到支付宝设置里面有个多语言这个功能,蛮有意思的,就想双休没事的话做个相关的demo玩玩,可是礼拜六被妹子拽出去玩了一天,来大上海有大半年了,基本没有出去玩过,妹子说我是超级宅男,也不带她出去 ...

  7. C#中常用的读取xml的几种方法(转)

    本文完全来源于http://blog.csdn.net/tiemufeng1122/article/details/6723764,仅作个人学习之用. XML文件是一种常用的文件格式,例如WinFor ...

  8. 在C#中创建和读取XML文件

    1.创建简单的XML文件 为了便于测试,我们首先创建控制台应用程序,项目命名为CreateXml,Program.cs代码如下: 这样会在C盘根目录下创建data2.xml文件,文件内容为 using ...

  9. C#中经常使用的几种读取XML文件的方法

    XML文件是一种经常使用的文件格式,比如WinForm里面的app.config以及Web程序中的web.config文件,还有很多重要的场所都有它的身影.Xml是Internet环境中跨平台的,依赖 ...

随机推荐

  1. springMVC如何判断入参是默认参数还是请求传过来的参数?

    springMVC如何判断入参是默认参数还是请求传过来的参数?

  2. spring-data-mongodb一个系统xml文件里面配置两个数据源

    spring-data-mongodb一个系统xml文件里面配置两个数据源 参考文档如下: http://www.iteye.com/problems/92789 http://stackoverfl ...

  3. Spring 3.0就这么简单读书笔记

    一般情况下,spring容器中的大部分Bean都是单实例的,所以一般无须通过@Repository.@Service.@Component等注解的value属性为Bean指定名称,也无须使用@Qual ...

  4. 杀掉linux所有进程的命令

    ps -ef|grep 'opt/*/tomcat_ssi'|grep -v "grep"|awk '{print $2}'|xargs kill -9

  5. CriticalFinalizerObject的作用

    CriticalFinalizerObject 在从 CriticalFinalizerObject 类派生的类中,公共语言运行库 (CLR) 保证所有关键终止代码都有机会执行, 即使是在 CLR 强 ...

  6. 使用Application_Error捕获站点错误并写日志

    Global.ascx页面使用以下方法即可捕获应用层没有try cath的错误 protected void Application_Error(Object sender, EventArgs e) ...

  7. 网络断开后重连downloadProvider继续下载问题调试分析

    最近在安卓4.4上遇到一个断开wifi后重新连接wifi, downloadProvider继续下载文件失败的问题.于是开始了解下载管理模块的断点续载功能:     1.首先,分析android lo ...

  8. Linux误删C基本运行库libc.so.6急救方法

    首先普及一下关于libc.so.6的基本常识: libc.so.6是glibc的软链接 ll  /lib64/libc.so.6lrwxrwxrwx 1 root root 11 Aug 27 201 ...

  9. ORACLE外键和锁

    在oracle中,如果外键未加索引,对父表的修改,会导致子表被加上全表锁.这包括两种情况: 1.删除父表中的行,如果外键上没有索引,会导致子表被加上全表锁 2.更新父表的主键(根据关系数据库的原则,更 ...

  10. 微信公众平台开发(一) ——实现URL接入

    一.填写服务器配置 登录微信公众平台,点击开发者中心,点击“修改配置”按钮,填写服务器地址(URL).Token和EncodingAESKey.URL是开发者用来接收微信消息和事件的接口URL.Tok ...