Visiting this url: "https://api.randomsite.com/api1/1/auth.asp?username=x&password=x"
Should generate this xml if the username and password are correct
<?xml version="1.0" encoding="ISO-8859-1" ?>
<auth>
<authentication>successful</authentication>
<token>{3FE7472B-E43C-442A-BE6D-2643239F3204}</token>
<expires>20110307</expires>
</auth>
I am trying to access this in VB.Net with this code:
Dim Login As XDocument = XDocument.Load("https://api.randomsite.com/api1/1/auth.asp?username=" + Username.Text + "&password=" + Password.Text)
Dim ResultofAuth As XElement = Login...<authentication>
If ResultofAuth = "successful" Then
Look Happy
Else
Look Sad because password probably incorrect!
End If
But I am generating an error with this:
Dim Login As XDocument = XDocument.Load("https://api.randomsite.com/api1/1/auth.asp?username=" + Username.Text + "&password=" + Password.Text)
The error says that XDocument.Load cannot be for external xml files. Is there a workaround to use an xml file from the web?