bahalyn33
bahalyn33

Reputation: 1

How to xml read from url with Asp.NET

How can I get the XML code in this link

https://www.betorder.com/GetLiveScore?qq=62642&sportTypeId=1&fid=0&lang=TR&countryId=all&checkBoxSelected=all

I'm trying to do but it does not

public void sonucAl() 
{
    string adres = "https://www.betorder.com/GetLiveScore?qq=62642&sportTypeId=1&fid=0&lang=TR&countryId=all&checkBoxSelected=all";
    WebRequest gelenIstek = HttpWebRequest.Create(adres);
    WebResponse gelenCevap;
    using (gelenCevap = gelenIstek.GetResponse())
    {
        using (StreamReader donenDeger = new StreamReader(gelenCevap.GetResponseStream()))
        {
            string gelenBilgi = donenDeger.ReadToEnd();
            string gonder = gelenBilgi;
            div.InnerHtml = gonder;
        }
    }
}

Upvotes: 0

Views: 965

Answers (1)

malkassem
malkassem

Reputation: 1957

I think what you are looking for can be found in the following post:

How to load XML from URL on XmlDocument()

From personal experience and based on the sample from the post above, below is how you would load the xml:

string m_strFilePath = "https://www.betorder.com/GetLiveScore?qq=62642&sportTypeId=1&fid=0&lang=TR&countryId=all&checkBoxSelected=all";
XmlDocument myXmlDocument = new XmlDocument();
myXmlDocument.Load(m_strFilePath); //Load NOT LoadXml

Upvotes: 1

Related Questions