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 ");
}
}