TG.WXCRM.V4/CRMServices/PkgSms/InterfaceExec/QQSmsUtil/QQSmsConfig.cs

67 lines
2.0 KiB
C#

using System.IO;
using System.Xml;
namespace WX.CRM.CRMServices.SMS.InterfaceExec
{
public class QQSmsConfig
{
string _appid = "";
string _appkey = "";
string _url = "";
public QQSmsConfig()
{
//加载配置
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}", "QQSmsConfig"));
if (xNode.Name == "QQSmsConfig")//LianTong
{
XmlNodeList node = xNode.ChildNodes;
foreach (XmlNode cn in node)
{
XmlElement temp = (XmlElement)cn;
switch (temp.GetAttribute("key"))
{
case "appid":
this._appid = temp.GetAttribute("value");
break;
case "appkey":
this._appkey = temp.GetAttribute("value");
break;
case "url":
this._url = temp.GetAttribute("value");
break;
}
}
}
}
}
catch { }
}
public string appid
{
get { return _appid; }
set { _appid = value; }
}
public string appkey
{
get { return _appkey; }
set { _appkey = value; }
}
public string url
{
get { return _url; }
set { _url = value; }
}
}
}