Error: authentication 401 when download XML file by using webclient

mfa237

New Member
I'm using this code to get XML data from URl:\[code\] using (WebClient wc = new WebClient()) { wc.Credentials = new NetworkCredential("admin", "admin"); string xml = wc.DownloadString("http://somedomain.com:8550/epe/postaglist"); XmlDocument tournamentsXML = new XmlDocument(); tournamentsXML.LoadXml(xml); XmlNodeList TagList = tournamentsXML.GetElementsByTagName("TAG"); foreach (XmlNode node in TagList) { XmlElement TagElement = (XmlElement)node; string TagID = TagElement.GetElementsByTagName("tagid")[0].InnerText; string MAC = TagElement.GetElementsByTagName("mac")[0].InnerText; Messagbox.Show(TagID+","+MAC)); } }\[/code\]And it work fine 100%.But when change the link to add query string like this:"http://somedomain.com:8550/epe/pos/taglist?fields=posgood"It give me authentication exception 401 Please note that it work fine on IE or firefox browsers !!I'm tired because still trying from yesterday to solve this exception and I can't :(
 
Back
Top