I am trying to download a file for xmlreader purposes. The file can download fine, but it won't let me read it.
This is what I have so far:
public void downloadXmlFile()
WebClient webClient = new WebClient();
webClient.DownloadFileAsync(new Uri("http://mysite", "c:\newxmlfile.xml");
This is how I try to read it:
reader2 = new XmlTextReader(xmlUrl2);
It's not liking the new XmlTextReader(xmlUrl2) which is the string of "C:\newxmlfile.xml".
Am I missing something obvious? The error message I'm getting is:
The process cannot access the file 'C:\newxmlfile.xml' because it is being used by another process.