FEAT-Command-in-FTP-Protocol - WeOnlyDo Software example code



All

wodCrypt (12)
wodSSH (10)
wodSFTP (23)
wodSSHServer (1)
wodSSHTunnel (11)
wodSSHpackage
wodSFTPdll

wodSSH.NET (10)
wodSFTP.NET (24)
wodFtpDLX.NET (22)
wodWebServer.NET (10)

wodAppUpdate (13)
wodHttpDLX (8)
wodFtpDLX (22)
wodTelnetDLX
wodFTPServer (3)
wodWebServer (10)
wodVPN
wodXMPP (13)
All ** [Visual Basic] ** [C#] ** [VB.NET] **

FEAT Command in FTP Protocol
VB code
Dim WithEvents wodFtpDLX As wodFtpDLXCom
Dim FEATResponse As String

Private Sub Form_Load()
    ' Initialize the component here
    Set wodFtpDLX = New wodFtpDLXCom

    ' Set default connection parameters to connect
    With wodFtpDLX
        .HostName = "xx"
        .Login = "xx"
        .Password = "xx"
        
        ' Initiate connection
        .Connect
    End With

End Sub

' Once connection is made, display response to FEAT command.
Private Sub wodFtpDLX_Connected(ByVal ErrorCode As Long, ByVal ErrorText As String)
    MsgBox FEATResponse, vbOKOnly, "Following features are supported by server: "
End Sub

' In order to receive reply to FEAT command, we will use FTPReply Event. Once "FEAT" is executed, we can
' check ReplyText for server's response to command.
Private Sub wodFtpDLX_FTPReply(ByVal Command As String, ByVal ReplyCode As Integer, ByVal ReplyText As String)
    If InStr(Command, "FEAT") > 0 Then
        FEATResponse = ReplyText
    End If
End Sub
VB.Net code
Dim WithEvents wodFtpDLX As WeOnlyDo.Client.FtpDLX
Dim FEATResponse As String

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    wodFtpDLX = New WeOnlyDo.Client.FtpDLX

    ' Set default connection parameters to connect
    With wodFtpDLX
        .Hostname = "xx"
        .Login = "xx"
        .Password = "xx"

        ' Initiate connection
        .Connect()
    End With

End Sub
' Once connection is made, display response to FEAT command.
Private Sub wodFtpDLX_ConnectedEvent(ByVal Sender As Object, ByVal Args As WeOnlyDo.Client.FtpConnectedArgs) Handles wodFtpDLX.ConnectedEvent
    MsgBox(FEATResponse, vbOKOnly, "Following features are supported by server: ")
End Sub

' In order to receive reply to FEAT command, we will use FTPReply Event. Once "FEAT" is executed, we can
' check ReplyText for server's response to command.
Private Sub wodFtpDLX_FtpReplyEvent(ByVal Sender As Object, ByVal Args As WeOnlyDo.Client.FtpReplyArgs) Handles wodFtpDLX.FtpReplyEvent
    If Args.Command = "FEAT" Then
        FEATResponse = Args.ReplyText
    End If
End Sub
C# code
private WeOnlyDo.Client.FtpDLX wodFtpDLX;
private String FEATResponse = String.Empty;

private void Form1_Load(object sender, EventArgs e)
{
    // Initialize component and events
    wodFtpDLX = new WeOnlyDo.Client.FtpDLX();
    wodFtpDLX.ConnectedEvent += new WeOnlyDo.Client.FtpDLX.ConnectedDelegate(wodFtpDLX_ConnectedEvent);
    wodFtpDLX.FtpReplyEvent += new WeOnlyDo.Client.FtpDLX.FtpReplyDelegate(wodFtpDLX_FtpReplyEvent);

    // Set default connection parameters to connect
    wodFtpDLX.Hostname = "xx";
    wodFtpDLX.Login = "xx";
    wodFtpDLX.Password = "xx";

    // Initiate connection
    wodFtpDLX.Connect();

}

// In order to receive reply to FEAT command, we will use FTPReply Event. Once "FEAT" is executed, we can
// check ReplyText for server's response to command.
void wodFtpDLX_FtpReplyEvent(object Sender, WeOnlyDo.Client.FtpReplyArgs Args)
{
    if (Args.Command == "FEAT")
    {
        FEATResponse = Args.ReplyText;
    }
}

// Once connection is made, display response to FEAT command.
void wodFtpDLX_ConnectedEvent(object Sender, WeOnlyDo.Client.FtpConnectedArgs Args)
{
    MessageBox.Show(FEATResponse, "Following features are supported on server:", MessageBoxButtons.OK);
}