title: Upload Progress Bar for file upload
body: <p>i have this code, how do i incorporate a progress bar into it?</p>
  
  <pre><code> Private Sub btn_upload_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_upload.Click
  
      Dim filePath As String = lbl_file.Text
      Dim slashPosition As Integer = filePath.LastIndexOf("\")
      Dim filenameOnly As String = filePath.Substring(slashPosition + 1)
  
  
      Dim request As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create("ftp://.com/public_html/windows/" &amp; filenameOnly), System.Net.FtpWebRequest)
      request.Credentials = New System.Net.NetworkCredential("", "")
      request.Method = System.Net.WebRequestMethods.Ftp.UploadFile
      Dim path As String = lbl_file.Text
  
      Dim file() As Byte = System.IO.File.ReadAllBytes(path)
  
      Dim strz As System.IO.Stream = request.GetRequestStream()
  
      strz.Write(file, 0, file.Length)
  
  
      strz.Close()
      strz.Dispose()
  
      MsgBox(path)
  
  
  
  
  End Sub
  </code></pre>