TG.WXCRM.V4/CRMServices/PkgSms/InterfaceModel/QiXinTongConfig.cs

94 lines
2.9 KiB
C#

using System.IO;
using System.Xml;
namespace WX.CRM.CRMServices.SMS.InterfaceModel
{
public class QiXinTongConfig
{
string _Assembly = "";
string _Url = "";
string _cpid = "";
string _signature = "";
int _mid = 0;
string _port = "";
string _keyCode = "";
//IDictionary<string, string> objectDefine = new Dictionary<string, string>();
public QiXinTongConfig()
{
string filename = System.AppDomain.CurrentDomain.BaseDirectory + "XML\\SmsAccountConfig.xml";
if (File.Exists(filename))
{
XmlDocument xDoc = new XmlDocument();
xDoc.Load(filename);
XmlNode xNode;
xNode = xDoc.SelectSingleNode(string.Format("//root//{0}", "QiXinTongConfig"));
if (xNode.Name == "QiXinTongConfig")
{
XmlNodeList node = xNode.ChildNodes;
foreach (XmlNode cn in node)
{
XmlElement temp = (XmlElement)cn;
switch (temp.GetAttribute("key"))
{
case "Assembly":
this._Assembly = temp.GetAttribute("value");
break;
case "Url":
this._Url = temp.GetAttribute("value");
break;
case "cpid":
this._cpid = temp.GetAttribute("value");
break;
case "signature":
this._signature = temp.GetAttribute("value");
break;
case "mid":
int.TryParse(temp.GetAttribute("value"), out _mid);
break;
case "port":
this._port = temp.GetAttribute("value");
break;
case "keyCode":
this._keyCode = temp.GetAttribute("value");
break;
}
}
}
}
}
public string Assembly
{
get { return _Assembly; }
}
public string Url
{
get { return _Url; }
}
public string cpid
{
get { return _cpid; }
}
public string signature
{
get { return _cpid; }
}
public int mid
{
get
{
return _mid;
}
}
public string port { get { return _port; } }
public string keyCode { get { return _keyCode; } }
}
}