I don’t think it can be done with FtpWebRequest
… The only way to specify a FTP command is through the Method
property, and the documentation states :
Note that the strings defined in the
WebRequestMethods.Ftp
class are the only supported options for theMethod
property. Setting theMethod
property to any other value will result in anArgumentException
exception.
SITE and SYST are not among the predefined options, so I guess you’re stuck…
Don’t waste time to try the WebClient
class, it will give you even less flexibility than FtpWebRequest
.
However, there are plenty of third-party FTP implementation, open source or commercial, and I’m pretty sure some of them can handle custom commands…