954,525 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

DownloadFileAsycn Only Download for One Times

Hi, i wrote a patch system. It check the links and download them, if the files not same with the users files.

All steps are working, i have only one problem. First download is perfectly complated, but when DownloadFileAsycn fired second times, its don't work. It creates strange file of 0 bytes, with name of second file.

Im posting a part of my codes.

progressBar1.Value = 0;
            string netdboyu = "0";
            string userdboyu = "0";
            string webdizin = "my url is here";
            


            WebClient indir = new WebClient();
            indir.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed);
            indir.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChanged);
indir.DownloadFileAsync(new Uri(webdizin + filename), (filename));// filename is parameter of function.


These codes are under a function. When download process complated im calling it again, im using switch function before called. With that, my update function is trying to download the correct file. But can't download.

wlalth
Newbie Poster
13 posts since Jun 2010
Reputation Points: 10
Solved Threads: 1
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You