I searched and found a lot of codes
and I made a code for myself for transfering file through ftp protocole
but I got some errors there that I dont know:-s
this is my code :
Dim FTPRequest As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create("ftp://ftp.microsoft.com/Softlib/" & "README.TXT"), System.Net.FtpWebRequest)
FTPRequest.Credentials = New System.Net.NetworkCredential("", "")
FTPRequest.Method = System.Net.WebRequestMethods.Ftp.DownloadFile
Dim stream As System.IO.Stream = FTPRequest.GetRequestStream
' Get the length of the content
Dim length As Integer = FTPRequest.ContentLength
' Set the maximum length of the progress bar.
ProgressBar1.Maximum = length
' Create a temporary array for the content of the file.
Dim bytes(length) As Byte
' Get all bytes of the content and advance the progress bar.
For i As Integer = 0 To length - 1
bytes(i) = stream.ReadByte()
ProgressBar1.Value = i
Label1.Text = i.ToString + "Bytes Downloaded"
Application.DoEvents()
Next
' Write the content to the output file.
Using output As IO.Stream = System.IO.File.Create("C:\Users\MeSam\desktop\file2.txt")
output.Write(bytes, 0, bytes.Length)
End Using
can you help me ?