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. css中的垂直居中方法

    单行文字 (外行高度固定) line-height 行高, 将line-height值与外部标签盒子的高度值设置成一致就可以了. height:3em; line-height:3em; 多行文字 图 ...

  2. Bzoj3990 [SDOI2015]排序

    Time Limit: 20 Sec  Memory Limit: 128 MBSubmit: 651  Solved: 338 Description 小A有一个1-2^N的排列A[1..2^N], ...

  3. wpf的学习日志(一)

    今天开始学习wpf,从xaml的布局开始 stackpanel布局:Orientation决定布局的横向还是纵向,HorizontalAlignment决定布局的对齐 <StackPanel O ...

  4. activiti总结

    1.activiti如何修改登录用户名?在哪个数据库里面添加. 2.activiti的启动和部署在http://activiti.org/userguide/index.html#demo.setup ...

  5. android SQLite使用SQLiteOpenHelper类对数据库进行增删查改

    一个简单的例子,当点击按钮时进行相应的操作,效果图如下: 项目代码如下: DatabaseHelper类 package com.example.sqlitedatebasetest; import ...

  6. 002_系统表查询(sysdatabases等)

    002_系统表查询(sysdatabases等) --1.获取所有数据库名: SELECT Name FROM Master..SysDatabases ORDER BY Name --2.获取所有表 ...

  7. Linux学习——环境变量设置

    一般来说,配置交叉编译工具链的时候需要指定编译工具的路径,此时就需要设置环境变量.例如我的mips-linux-gcc编译器在“/opt/au1200_rm/build_tools/bin”目录下,b ...

  8. C++:MEMSET的大坑三两事

    之前写了一题费用流,竟然硬是在写SPFA时为DIS数组赋初始值用了MEMSET数组QAQ 调试了很久也没有弄明白自己是卡在那里了,,,感觉被自己蠢哭了QWQ 错误的姿势!! #include < ...

  9. C# 解析User-Agent工具

    分享一个解析User-Agent的程序集: Neget程序集名称:UAParser Github下载地址:https://github.com/qiailu/uap-csharp 扩展程序集:UAPa ...

  10. php生成table表格

    function getTable($arrTh, $arrTr){ $s = '<table class="tbData">'; $s .= '<tr>' ...