<?xml version="1.0" encoding="utf-8"?>
<Key>
<StoreName>name</StoreName>
<AccessToken>11111111111111111111111</AccessToken>
<APIContext>www.baidu.com.api</APIContext>
</Key>
name是Key.xml
string pathServ= AppDomain.CurrentDomain.BaseDirectory + "key.xml";//路径
//判断是否存在资源文件
if (!File.Exists(pathServ))
{
DXMessageBox.Show("缺少必要的服务配置文件");
return;
}
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(pathServ);
string AccessToken = xmldoc["Key"]["AccessToken"].InnerText;//取11111111111111111111111
&n