Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Response of the FTP server

Response of the FTP server

Scheduled Pinned Locked Moved C#
csharpcomsysadmin
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    abbd
    wrote on last edited by
    #1

    Hello, I use this code to send files to the FTP server :

    FtpWebRequest myRequest = (FtpWebRequest)FtpWebRequest.Create(ftp://ftp.server.com/test.txt);
    myRequest.Credentials = new NetworkCredential(TEST,HEROS);
    myRequest.Method = WebRequestMethods.Ftp.UploadFile;

    FileStream stream = File.OpenRead(@"c:\test.txt");
    byte[] buffer = new byte[stream.Length];
    stream.Read(buffer, 0, buffer.Length);
    stream.Close();

    Stream reqStream = myRequest.GetRequestStream();
    reqStream.Write(buffer, 0, buffer.Length);
    reqStream.Close();

    How i can receive the reponse, the server ftp return an ID of commande, i can see this number in FilZilla, bu i need to retrieve this id on C#, thank you verry mutch.

    B 1 Reply Last reply
    0
    • A abbd

      Hello, I use this code to send files to the FTP server :

      FtpWebRequest myRequest = (FtpWebRequest)FtpWebRequest.Create(ftp://ftp.server.com/test.txt);
      myRequest.Credentials = new NetworkCredential(TEST,HEROS);
      myRequest.Method = WebRequestMethods.Ftp.UploadFile;

      FileStream stream = File.OpenRead(@"c:\test.txt");
      byte[] buffer = new byte[stream.Length];
      stream.Read(buffer, 0, buffer.Length);
      stream.Close();

      Stream reqStream = myRequest.GetRequestStream();
      reqStream.Write(buffer, 0, buffer.Length);
      reqStream.Close();

      How i can receive the reponse, the server ftp return an ID of commande, i can see this number in FilZilla, bu i need to retrieve this id on C#, thank you verry mutch.

      B Offline
      B Offline
      BobJanova
      wrote on last edited by
      #2

      Use GetResponse[^]. (Also, learn to search, and use the documentation. I found that just from looking at the FtpWebRequest page on MSDN.)

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups