64 lines
1.8 KiB
C#
64 lines
1.8 KiB
C#
using System.IO;
|
|
using System.Xml;
|
|
|
|
namespace WX.CRM.CRMServices.SMS.InterfaceModel
|
|
{
|
|
public class YiZhengConfig2
|
|
{
|
|
public YiZhengConfig2()
|
|
{
|
|
//加载配置
|
|
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}", "YZSms2Config"));
|
|
if (xNode.Name == "YZSms2Config")
|
|
{
|
|
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;
|
|
set;
|
|
}
|
|
|
|
public string pwd
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
public string url
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
}
|
|
}
|