using System.XML;
public KSBMCONFIG ReadConfig(string XMLConfigFile)
{
KSBMCONFIG _conf = new KSBMCONFIG ();
try
{
// Open an XML file
System.Xml.XMLTextReader reader;
reader = new System.Xml.XmlTextReader(XMLConfigFile);
while ( reader.Read() )
{
if((reader.NodeType == XMLNodeType.EndElement)
&&(reader.Name == "KSBM"))
{
break;
}
if(reader.IsStartElement ("ServerPath"))
{
reader.Read ();
_conf.ServerPath = reader.Value ;
}
else if(reader.IsStartElement ("SmtpServer"))
{
reader.Read ();
_conf.SMTPServer = reader.Value ;
}
else if(reader.IsStartElement ("ConnectString"))
{
reader.Read ();
_conf.ConnectString = reader.Value ;
}
}
return _conf;
}
catch
{
_conf.ConnectString = "";
_conf.ServerPath = "";
_conf.SMTPServer = "";
return _conf;
}
finally
{
}
}