ASPスクリプトで作成した動的xmlを読み込もうとしていますが、残念ながら読み込めませんでした。私のC#コードはASPスクリプトを理解できないようです。
いくつかの提案を聞いてうれしいです。
ここでASPスクリプトを見ることができます:http ://www.ad-net.co.il/test.asp
<%
Response.Buffer = True
Response.ContentType = "text/xml"
body = ""
body = body & "<?xml version=""1.0"" encoding=""utf-8""?>"
body = body & "<PROGRAM>"
body = body & "<EMAIL>email@gmail.com</EMAIL>"
body = body & "<USERNAME>username@gmail.com</USERNAME>"
body = body & "<PASSWORD>password</PASSWORD>"
body = body & "</PROGRAM>"
Response.Write(body)
%>
C#コードは次のとおりです。
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");
}
}