class ServerUtils
{
private static ServerUtils _instance = new ServerUtils();
public static ServerUtils getInstance()
{
return _instance;
}
XmlDocument doc = new XmlDocument();
private string serverIp;
private string typecode;
public string getServerIp()
{
doc.Load("XMLFile1.xml");
XmlNode node = doc.SelectSingleNode("tongbu/server_ip");
serverIp = node.FirstChild.Value;
return serverIp;
}
public string gettypecheck()
{
XmlDocument doc = new XmlDocument();
doc.Load("XMLFile1.xml");
XmlNode node = doc.SelectSingleNode("tongbu/type");
typecode = node.FirstChild.Value;
return typecode;
}
public void ModifServerIP(string str)
{
XmlDocument doc = new XmlDocument();
doc.Load("XMLFile1.xml");
XmlNode node = doc.SelectSingleNode("tongbu/server_ip");
XmlElement xe = (XmlElement)node;
xe.InnerText = str;
doc.Save("XMLFile1.xml");
}
public void Modiftypecode(string str)
{
XmlDocument doc = new XmlDocument();
doc.Load("XMLFile1.xml");
XmlNode node = doc.SelectSingleNode("tongbu/type");
XmlElement xe = (XmlElement)node;
xe.InnerText = str;
doc.Save("XMLFile1.xml");
}
}