Read an dynamic xml from dynamic asp script

freeminseran

New Member
I'm trying to read a dynamic xml who created by ASP script, but unfortunately I was unable to. It seems that my C# code can't understand the ASP script.I'll be happy to hear some suggestions.You can see the ASP script here: http://www.ad-net.co.il/test.asp\[code\]<%Response.Buffer = TrueResponse.ContentType = "text/xml"body = ""body = body & "<?xml version=""1.0"" encoding=""utf-8""?>"body = body & "<PROGRAM>"body = body & "<EMAIL>[email protected]</EMAIL>"body = body & "<USERNAME>[email protected]</USERNAME>"body = body & "<PASSWORD>password</PASSWORD>"body = body & "</PROGRAM>"Response.Write(body)%>\[/code\]The C# code is:\[code\]private static void LoadXmlFromServerToProgram() { try { XmlDocument xDoc = new XmlDocument(); xDoc.Load("http://www.ad-net.co.il/test.asp"); EMAIL = xDoc.DocumentElement.SelectSingleNode("EMAIL").InnerText; USERNAME = xDoc.DocumentElement.SelectSingleNode("USERNAME").InnerText; PASSWORD = xDoc.DocumentElement.SelectSingleNode("PASSWORD").InnerText; } catch { MessageBox.Show("Can't Read From XML"); } }\[/code\]
 
Back
Top