|
-
Jun 19th, 2002, 05:58 PM
#1
Thread Starter
New Member
how can i do two things at oncce
Hi
I am tring to write a small ftp client in vb.net, i can get it do download file using wininet.dll and ftpgetfile to download the file, but as the files i want to download may be large i need some sort of progress indicator to show how much of the total is downloaded.
i have tried using the file size.maxvalue indicatiors, but this won't work cos when i call the ftpgetfile, the system is stuck until then entire file is downloaded. how can i make this so it has a progress bar or shows the user how much has come down.
any help would be much appreciated
cheers
YH
-
Jun 19th, 2002, 06:03 PM
#2
You need to do some multithreading. You need to put the download operation on a seperate thread. Here is an article on the MSDN library site that should give you more information than you need to do this:
http://msdn.microsoft.com/library/de...syncprocvb.asp
Have fun.
-
Jun 20th, 2002, 03:26 AM
#3
Hyperactive Member
Well threading in .net is cool but good http/ftp dlls should provide events to allow for download progress checking.
-
Jun 20th, 2002, 01:05 PM
#4
Addicted Member
You should fire the application.doevents method every now again so that the screen gets updated.
You could also use a timer, and place the doevents in a timer.
-
Jun 20th, 2002, 04:22 PM
#5
Originally posted by BryanJ
You should fire the application.doevents method every now again so that the screen gets updated.
You could also use a timer, and place the doevents in a timer.
You shouldn't have to do that in VB.Net, at least not for what is being asked.
For the problem at hand, having the download process and checking on a seperate thread is going to be ideal. You don't want something locking up the main form, and a seperate thread will do this. Have an object fire events to the main form telling the current status of the download. Then handle the UI implementation there.
-
Jun 20th, 2002, 08:38 PM
#6
Addicted Member
You are right, it is messy and it will sure to be a problem later.
Creating another thread is the best solution.
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
|