title: Error unable to connect to remote server when upload file to remote server
body: <p>I use this code to upload file to server.</p>
  
  <pre><code>Dim clsRequest As System.Net.FtpWebRequest = _
                  DirectCast(System.Net.WebRequest.Create(a), System.Net.FtpWebRequest)
              clsRequest.Credentials = New System.Net.NetworkCredential(username, pwd)
              clsRequest.Method = System.Net.WebRequestMethods.Ftp.UploadFile
  
              ' read in file...
              Dim bFile() As Byte = System.IO.File.ReadAllBytes(pdfPath)
  
              ' upload file...
              Dim clsStream As System.IO.Stream = _
                  clsRequest.GetRequestStream()
              clsStream.Write(bFile, 0, bFile.Length)
              clsStream.Close()
              clsStream.Dispose()
  </code></pre>
  
  <p>But is show error unable to connect to remote server at line   Dim clsStream As System.IO.Stream = _
                      clsRequest.GetRequestStream(). Any wrong?</p>