70 lines
2.1 KiB
C#
70 lines
2.1 KiB
C#
using System.IO;
|
|
using System.Xml;
|
|
|
|
namespace WX.CRM.CRMServices.PkgSms.InterfaceModel
|
|
{
|
|
public class upCatConfig
|
|
{
|
|
string _account = "";
|
|
string _pwd = "";
|
|
string _url = "";
|
|
public upCatConfig()
|
|
{
|
|
//加载配置
|
|
string filename = System.AppDomain.CurrentDomain.BaseDirectory + "XML\\SmsAccountConfig.xml";
|
|
try
|
|
{
|
|
if (File.Exists(filename))
|
|
{
|
|
XmlDocument xDoc = new XmlDocument();
|
|
xDoc.Load(filename);
|
|
XmlNode xNode;
|
|
xNode = xDoc.SelectSingleNode(string.Format("//root//{0}", "upCat"));
|
|
if (xNode.Name == "upCat")
|
|
{
|
|
XmlNodeList node = xNode.ChildNodes;
|
|
foreach (XmlNode cn in node)
|
|
{
|
|
XmlElement temp = (XmlElement)cn;
|
|
switch (temp.GetAttribute("key"))
|
|
{
|
|
case "account":
|
|
this._account = temp.GetAttribute("value");
|
|
break;
|
|
case "pwd":
|
|
this._pwd = temp.GetAttribute("value");
|
|
break;
|
|
case "url":
|
|
this._url = temp.GetAttribute("value");
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
catch
|
|
{
|
|
throw;
|
|
}
|
|
}
|
|
|
|
public string account
|
|
{
|
|
get { return _account; }
|
|
set { _account = value; }
|
|
}
|
|
|
|
public string pwd
|
|
{
|
|
get { return _pwd; }
|
|
set { _pwd = value; }
|
|
}
|
|
|
|
public string url
|
|
{
|
|
get { return _url; }
|
|
set { _url = value; }
|
|
}
|
|
}
|
|
}
|