arşiv

Cuma, 25 Eyl 2020 için arşiv

Reading XML data into DataTable (c#)

Cuma, 25 Eyl 2020 yorum yok
System.Net.HttpWebRequest webRequest = (HttpWebRequest)System.Net.WebRequest.Create("URL");
webRequest.Credentials = System.Net.CredentialCache.DefaultCredentials;
webRequest.Accept = "text/xml";
webRequest.AllowAutoRedirect = true;
System.Net.HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
System.IO.Stream s = webResponse.GetResponseStream();
StreamReader r = new StreamReader(s);
string xml = r.ReadToEnd();
Response.Write(xml);
s.Close();
r.Close();
webResponse.Close();
Categories: Genel Tags: