|
-
Jul 16th, 2002, 07:30 PM
#1
Thread Starter
yay gay
how do i make syncronous downloads?
i searched for code to download files with vb.net...i came out with this:
string remoteUri = "http://www.contoso.com/library/homepage/images/";
string fileName = "ms-banner.gif", myStringWebResource = null;
// Create a new WebClient instance.
WebClient myWebClient = new WebClient();
// Concatenate the domain with the Web resource filename.
myStringWebResource = remoteUri + fileName;
listBox1.Items.Add("Downloading File "+fileName.ToString()+" from "+myStringWebResource.ToString()+" ....");
// Download the Web resource and save it into the current filesystem folder.
myWebClient.DownloadFile(myStringWebResource,fileName);
listBox1.Items.Add("Successfully Downloaded File "+fileName.ToString() +" from "+myStringWebResource.ToString());
listBox1.Items.Add("Downloaded file saved in the following file system folder:");
listBox1.Items.Add(Application.StartupPath.ToString() );
it's in C#, but no problem, i can turn it into VB easyly...the problem is that the program freezes while downloading...how do i download files without the all program freezes while downloading...?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|