OPTS Command in FtpWebRequest / FtpWebResponse

I use the FtpWebRequest and FtpWebResponse objects in the System.Net namespace to issue a LIST command. The problem I am facing is that the FTP server I am connecting to does not have an OPTS command.

Is there a way to prevent the FtpWebRequest OPTS command from executing?

+3
source share
3 answers

I'm afraid that you cannot do this ... According to Reflector, it seems to be hard-coded in the class's internal method ( FtpControlStream.BuildCommandsList), so you cannot override it. However, this should not be a problem, the request should continue even if the OPTS command does not work (see the code FtpControlStream.PipelineInstructionin the reflector)

+4
source

, ... ftp- OPTS UTF8, UTF8. ( , "OPTs UTF8" FTP, UTF8 .) .NET Ftp , OK OPTS UTF8... , MS - UTF8 , , UTF8, .

+2

, , FtpWebRequest:

  • async (/)
  • WriteCallbackDelegate FtpWebRequest CommandStream.
  • CommandStream Commands

I wrote some details of the project on how to do this, but feel free to comment there / here or email me if anyone sees this and needs more details.

+2
source

Source: https://habr.com/ru/post/1719756/


All Articles