This is a continuation of this question: How to load XML into a DataTable?
I want to read an XML file on the Internet in a DataTable. The XML file is here: http://rates.fxcm.com/RatesXML
If I do this:
public DataTable GetCurrentFxPrices(string url) { WebProxy wp = new WebProxy("http://mywebproxy:8080", true); wp.Credentials = CredentialCache.DefaultCredentials; WebClient wc = new WebClient(); wc.Proxy = wp; MemoryStream ms = new MemoryStream(wc.DownloadData(url)); DataSet ds = new DataSet("fxPrices"); ds.ReadXml(ms); DataTable dt = ds.Tables["Rate"]; return dt; }
It works great. I am struggling with how to use the default proxy installed in Internet Explorer. I do not want to hard code proxies. I also want the code to work if the proxy is not specified in Internet Explorer.
source share