How much bytes I receive during download

yulyos

Well-known member
Joined
Jun 4, 2004
Messages
67
Location
Israel
Programming Experience
5-10
Hi,

How can I know how much bytes I receive during download a file with object my?
Example:
My.Computer.Network.DownloadFile("http://www.MyWebSite/downloads/FileName", "C:\MyPath\FileName")

Thanks I advance
 
A. DownloadFile isn't asynchronous, it blocks until finished download, if you want progress you can use one of the DownloadFile overloads where you set ShowUI to True, this will display progress dialog.

B. For more control over the download look into WebClient class and the OpenRead method, or even HttpWebRequest.

C. If you meant just wanted to know how much was downloaded you use the IO.FileInfo and check its Length property afterwards, it will read the filesize.
 
Example of what?
 
Set the ShowUI parameter of the DownloadFile method to true. see the attachment.
 

Attachments

  • ShowUI.gif
    ShowUI.gif
    2.8 KB · Views: 38
Back
Top