Use-FTP-with-Proxy - 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] **

Use FTP with Proxy
Set ProxyType property to change type of Proxy you are connecting to.
VB code
Dim WithEvents wodFtpDLX As wodFtpDLXCom
Private Sub Form_Load()
    Set wodFtpDLX = New wodFtpDLXCom

    ' Set proxy related parameters
    wodFtpDLX.ProxyHostname = "your_proxy_address"
    wodFtpDLX.ProxyType = ProxyWEBStandard
    
    ' ProxyLogin and ProxyPassword are only needed if your Proxy needs authentication
    wodFtpDLX.ProxyLogin = "your_proxy_login"
    wodFtpDLX.ProxyPassword = "your_proxy_password"
    
    wodFtpDLX.ProxyPort = 8080
    
    ' Set basic connection parameters
    wodFtpDLX.HostName = "xx"
    wodFtpDLX.Login = "xx"
    wodFtpDLX.Password = "xx"
    wodFtpDLX.Protocol = FTP

    ' Initiate the connection
    wodFtpDLX.Connect
End Sub

' Connected event is triggered when Connection is successful/or fails. If connection failed
' ErrorCode will be <> 0, and in that case, ErrorText will contain description of an error
' which occured.
Private Sub wodFtpDLX_Connected(ByVal ErrorCode As Long, ByVal ErrorText As String)
    If ErrorCode = 0 Then
        ' Since we're connected, we can now do next action, i.e. GetFile, PutFile, ListDir etc...
    End If
End Sub
C# code
private WeOnlyDo.Client.FtpDLX wodFtpDLX;
private void Form1_Load(object sender, EventArgs e)
{
    wodFtpDLX = new WeOnlyDo.Client.FtpDLX();
    // Declare events
    wodFtpDLX.ConnectedEvent +=new WeOnlyDo.Client.FtpDLX.ConnectedDelegate(wodFtpDLX_ConnectedEvent);
    wodFtpDLX.DoneEvent +=new WeOnlyDo.Client.FtpDLX.DoneDelegate(wodFtpDLX_DoneEvent);

    // Set proxy related parameters
    wodFtpDLX.ProxyHostname = "your_proxy_address";
    wodFtpDLX.ProxyType = WeOnlyDo.Net.Sockets.ProxyTypes.ProxyWEBStandard;

    // ProxyLogin and ProxyPassword are only needed if your Proxy needs authentication</span>
    wodFtpDLX.ProxyLogin = "your_proxy_login";
    wodFtpDLX.ProxyPassword = "your_proxy_password";

    wodFtpDLX.ProxyPort = 8080;
    
    // Set basic connection parameters
    wodFtpDLX.Hostname = "xx";
    wodFtpDLX.Login = "xx";
    wodFtpDLX.Password = "xx";
    wodFtpDLX.Protocol = WeOnlyDo.Client.Protocols.FTP;

    // Initiate the connection
    wodFtpDLX.Connect();
}

' Connected event is triggered when Connection is successful/or fails. If connection failed
' Args parameter will contain exception of an error
void wodFtpDLX_ConnectedEvent(object Sender, WeOnlyDo.Client.FtpConnectedArgs Args)
{
    // Since we're connected, we can now do next action, i.e. GetFile, PutFile, ListDir etc...
}
VB.NET code
Dim WithEvents wodFtpDLX As WeOnlyDo.Client.FtpDLX
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    wodFtpDLX = New WeOnlyDo.Client.FtpDLX
    
    ' Set proxy related parameters
    wodFtpDLX.ProxyHostname = "your_proxy_address"
    wodFtpDLX.ProxyType = WeOnlyDo.Net.Sockets.ProxyTypes.ProxyWEBStandard

    ' ProxyLogin and ProxyPassword are only needed if your Proxy needs authentication</span>
    wodFtpDLX.ProxyLogin = "your_proxy_login"
    wodFtpDLX.ProxyPassword = "your_proxy_password"

    wodFtpDLX.ProxyPort = 8080
    
    ' Set basic connection parameters
    wodFtpDLX.Hostname = "xx"
    wodFtpDLX.Login = "xx"
    wodFtpDLX.Password = "xx"
    wodFtpDLX.Protocol = WeOnlyDo.Client.Protocols.FTP

    ' Initiate the connection
    wodFtpDLX.Connect()
End Sub

' Connected event is triggered when Connection is successful/or fails. If connection failed
' Args parameter will contain exception of an error
Private Sub wodFtpDLX_ConnectedEvent(ByVal Sender As Object, ByVal Args As WeOnlyDo.Client.FtpConnectedArgs) Handles wodFtpDLX.ConnectedEvent
    ' Since we're connected, we can now do next action, i.e. GetFile, PutFile, ListDir etc...
End Sub