You should request Ftp.GetFileSize and read the response. I dropped the progressbar from your code because ContentLength does not return the filesize (actually reading ContentLength causes an error). In the code above you request something from the server and the server sends you a response. And secondly, everything you do with the web is always more or less error prone.īasic problem in your code is understanding how communication works between server and the client. Using output As IO.Stream = System.IO.File.Create("C:\Users\MeSam\desktop\file2.txt")įirst, use Try to catch the error. Label1.Text = i.ToString "Bytes Downloaded" ' Get all bytes of the content and advance the progress bar. ' Create a temporary array for the content of the file. ' Set the maximum length of the progress bar. This is my code : Dim FTPRequest As = DirectCast((" "
0 Comments
Leave a Reply. |