I have Visual Studio 11 (Windows 8 Developer) i have create a downloader file:
string sUrlToReadFileFrom = "http://mysite/1.mp3";
int iLastIndex = sUrlToReadFileFrom.LastIndexOf('/');
string sDownloadFileName = sUrlToReadFileFrom.Substring(iLastIndex + 1, (sUrlToReadFileFrom.Length - iLastIndex - 1));
client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client_DownloadProgressChanged);
client.DownloadFileCompleted += new AsyncCompletedEventHandler(client_DownloadFileCompleted);
client.DownloadFileAsync(new Uri("http://mysite/1.mp3"), "C:\\Windows\\Temp" + "\\" + sDownloadFileName);
But it doesn't work start! If I change the folder "C:\Windows\Temp" in "E:\Temp" the download start. The drive C:\ doesn't work, why? It is possible save in temp folder or you've other idea?
Not having played with Widnows 8 yet, this is only conjecture, but it's likely you don't have write permissions to that location on the C:\ as a standard privilege user.
try with this:
string tempPath = System.IO.Path.GetTempPath();
does it work?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With