日期:2014-05-17 浏览次数:20808 次
private const string ACC_PATH = "day\\AccName.xml";
private const string USER_NODE = "root/Account/user";
private void InitData()
{
int Respond = 0;
xObj = new XmlFile();
if ((Respond = xObj.ReadXML(ACC_PATH, USER_NODE, "id")) == 0)
{
mUser = xObj.mValue;
}
if ((Respond = xObj.ReadXML(ACC_PATH, USER_NODE, "password")) == 0)
{
mPassWord = xObj.mValue;
}
}
public class XmlFile : XmlDocument
{
int integer;
string[] mStr1 = new string[5];
public string[] mValue = new string[5];
public int ReadXML(string mPath,string mName,string mChild)
{
string mStr="";
int i = 0;
try
{
this.Load(mPath);
XmlNode node = this.SelectSingleNode(mName);
XmlNodeList list = this.SelectNodes(mName);
if (node != nul