I'm wondering if anyone knows this. I have got the FTP example application from the Base Class Libraries code samples for VB.net, which uses the class file below to download a file from the remote ftp

What is the function to send a file to the remote ftp? Does anyone know?

VB Code:
  1. Imports System.IO
  2. Imports System.Net
  3. Imports System.Text
  4.  
  5. Public Class SimpleFTPClient
  6.  
  7.     Public Function Download(ByVal destinationFile As String, ByVal downloadUri As Uri) As FtpStatusCode
  8.  
  9.         Try
  10.             ' Check if the URI is and FTP site
  11.             If Not (downloadUri.Scheme = Uri.UriSchemeFtp) Then
  12.                 Throw New ArgumentException("URI is not an FTp site")
  13.             End If
  14.  
  15.             ' Set up the request
  16.             Dim ftpRequest As FtpWebRequest = CType(WebRequest.Create(downloadUri), FtpWebRequest)
  17.  
  18.             ' use the provided credentials
  19.             If Me.m_isAnonymousUser = False Then
  20.                 ftpRequest.Credentials = New NetworkCredential(Me.m_userName, Me.m_password)
  21.             End If
  22.  
  23.             ' Download a file. Look at the other methods to see all of the potential FTP features
  24.             ftpRequest.Method = WebRequestMethods.Ftp.DownloadFile
  25.  
  26.             ' get the response object
  27.             Dim ftpResponse As FtpWebResponse = CType(ftpRequest.GetResponse, FtpWebResponse)
  28.             Dim stream As Stream = Nothing
  29.             Dim reader As StreamReader = Nothing
  30.             Dim writer As StreamWriter = Nothing
  31.  
  32.             ' get the file as a stream from the response object and write it as
  33.             ' a file stream to the local PC
  34.             Try
  35.                 stream = ftpResponse.GetResponseStream
  36.                 reader = New StreamReader(stream, Encoding.UTF8)
  37.                 writer = New StreamWriter(destinationFile, False)
  38.                 writer.Write(reader.ReadToEnd)
  39.                 Return ftpResponse.StatusCode
  40.             Finally
  41.                 ' Allways close all streams
  42.                 stream.Close()
  43.                 reader.Close()
  44.                 writer.Close()
  45.             End Try
  46.         Catch ex As Exception
  47.             Throw ex
  48.         End Try
  49.  
  50.     End Function
  51.  
  52.     Public Property UserName() As String
  53.         Get
  54.             Return Me.m_userName
  55.         End Get
  56.         Set(ByVal value As String)
  57.             Me.m_userName = value
  58.         End Set
  59.     End Property
  60.  
  61.     Public Property Password() As String
  62.         Get
  63.             Return Me.m_password
  64.         End Get
  65.         Set(ByVal value As String)
  66.             Me.m_password = value
  67.         End Set
  68.     End Property
  69.  
  70.     Public Property IsAnonymousUser() As Boolean
  71.         Get
  72.             Return Me.m_isAnonymousUser
  73.         End Get
  74.         Set(ByVal value As Boolean)
  75.             Me.m_isAnonymousUser = value
  76.         End Set
  77.     End Property
  78.  
  79.     Private m_userName As String
  80.     Private m_password As String
  81.     Private m_isAnonymousUser As Boolean
  82.  
  83. End Class