Hi guys...
I'm trying to put in a IF statement that checks to see if there is any STMP Value within the XML file. Code is below...
Code:
private void Send_Click(object sender, EventArgs e)
{
if (File.Exists(@"C:\Timewade\Quickticket\Person.xml"))
{
XmlNodeList detailsCheck = smtpDetails.GetElementsByTagName("SMTP_Server");
if (detailsCheck[0].InnerText == null)
{
MessageBox.Show("Please Fill in SMTP Details");
}
smtpDetails = new XmlDocument();
smtpDetails.Load(PATH);
Stepping-through the code it does hit the first part of the "IF" Statement but after that ignores the 'MessageBox' and continues through to an exception.
The XML I believe is blank, Below is Blank XML generated by C#.
Code:
<?xml version="1.0" encoding="UTF-8" standalone="true"?>
-<Table> -<SMTP_details> <SMTP_Server/> <SMTP_Port/> <SMTP_Username/> <SMTP_Password/> <Company_Name/> <Company_Tel/> </SMTP_details> </Table>
am i trying to check the wrong section???