<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<!--测试环境数据-->
<add key="Appkey" value="12337722" />
<add key="Appsecret" value="sandboxda3e9856fbb65050b45a5efef" />
<add key="Url" value="http://gw.api.tbsandbox.com/router/rest" />
<add key="SessionKey" value="" />
<!--正式环境数据-->
<add key="OnLineAppkey" value="12337722" />
<add key="OnLineAppsecret" value="0ed1394da3e9856fbb65050b45a5efef" />
<add key="OnLineUrl" value="http://gw.api.taobao.com/router/rest" />
<add key="OnLineSessionKey" value="" />
</appSettings>
</configuration>
上面是我的xml格式
public class ConfigModel
{
public string TandBoxAppkey { get; set; }
public string TandBoxAppsecret { get; set; }
public string TandBoxUrl{get;set;}
public string TandBoxSessionKey { get; set; }
public string OnLineAppkey { get; set; }
public string OnLineAppsecret { get; set; }
public string OnLineUrl { get; set; }
public string OnLineSessionKey { get; set; }
}
上面是我定义的实体
我想通过linq to xml读取内容然后构造实体model返回
求指点