Guest User

Untitled

a guest
Sep 25th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. FtpWebRequest request =
  2. (FtpWebRequest)WebRequest.Create("ftp://ftp.example.com/remote/path/file.zip");
  3. request.Credentials = new NetworkCredential("username", "password");
  4. request.Method = WebRequestMethods.Ftp.UploadFile;
  5.  
  6. using (Stream fileStream = File.OpenRead(csvfilestring))
  7. using (Stream ftpStream = request.GetRequestStream())
  8. {
  9. fileStream.CopyTo(ftpStream);
  10. }
Add Comment
Please, Sign In to add comment