FtpWebRequest and custom commands

How can i send custom command through an FtpWebRequest

I tried with this but it doesn't work :(



using System;

using System.Collections.Generic;

using System.Text;

using System.Net;

using System.Net.Sockets;

using System.IO;

namespace ftpProva

{

class Program

{

static void Main(string[] args)

{

   FtpWebRequest ftp = (FtpWebRequest)WebRequest.Create ("ftp://ftp.microsoft.com");

   ftp.EnableSsl = true;

   ftp.Method = "SYST";

   ftp.Proxy = null;

   FtpWebResponse response = ftp.GetResponse () as FtpWebResponse;

   response.Close ();

   Console.WriteLine (response.StatusDescription);

}

}

}

 



It says that "the method is invalid" referred to the ftp.Method line.

Thanks in advance for your help



Answer this question

FtpWebRequest and custom commands

  • MissJ

    We are thinking of a much more enhanced FTP client for the next version... :-)

  • 280Z28

    That's a bad thing :( however thanks for the answer.
  • John Kennedy

     We do not support custom FTP commands. It has to be one of those defined in WebRequestMethods.Ftp
  • FtpWebRequest and custom commands