When I tried to get the XML file from a website that required credentials, I used the following:
public static void GetFileWithCredentials(string userName, string password, string url) { using (WebClient wc = new WebClient()) { wc.Credentials = new NetworkCredential(userName, password); string xml = wc.DownloadString(url); XmlDocument tournamentsXML = new XmlDocument(); tournamentsXML.LoadXml(xml); } }
Hope this will be helpful for you. If it werenβt possible to publish an example of what the data you are trying to get looks like? I would comment first, but my reputation doesn't seem to allow me!
source share