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. 查看linux系统版本

    1.查看内核版本 #cat /proc/version Linux version 2.6.18-164.el5 (mockbuild@x86-003.build.bos.redhat.com) (g ...

  2. #include<iostream.h>与#include<iostream> using namespace std的区别

    所谓namespace,是指标识符的各种可见范围.C++标准程序库中的所有标识符都被定义于一个名为std的namespace中.  一 :<iostream>和<iostream.h ...

  3. TP框架多表联查

    join方法import("@.ORG.Page");        $Form   =   M('gly');        $where='';        if ($_PO ...

  4. 小学生之JAVA中的分层

    三层架构 三层架构(3-tier application) 通常意义上的三层架构就是将整个业务应用划分为:表现层(UI).业务逻辑层(BLL).数据访问层(DAL). 区分层次的目的即为了“高内聚,低 ...

  5. GridView and DropDownList

    <form id="form1" runat="server"> <div> <asp:GridView runat=" ...

  6. swift 重载 泛式 inout的使用

    swift 重载 泛式 inout的使用 函数 func 关键字 -> 表示返回值信息等等 那我们接下来利用函数做几件事情 -a 比较两个数字的大小 -b 比较两个字符串 -c 既能比较字符串, ...

  7. Probably at least one of the constraints in the following list is one you don't want.

    这个提示并不是出错,不理会它我的程序也没出现什么问题 但是处于强迫症,还是努力寻找解决的方法... 最终发现问题如下: 在xib各种绘制和添加约束的UITableViewCell之后,在某一特定情况想 ...

  8. V9 二次开发技术篇之 模型数据库

    应V9粉丝的建议,本人今天讲一下 MVC中的M 数据库模型 首先 在 phpcms\model  建一个模型文件test_model.class.php <?phpdefined('IN_PHP ...

  9. 类似a:hover的伪类的注解

    a:link { font-size: 14pt; text-decoration: underline; color: blue; } /*设置a对象在未被访问前的样式表属性 .*/ a:hover ...

  10. Hibernate数据库对象的创建与导出

    Hibernate 与数据库的关系是ORM关系,对象映射数据库. 那么如何通过对象对数据库进行各种对象的ddl与dml操作呢? 数据库对象操作的〈database-object /〉+ SchemaE ...