Provides data for the
StateChanged event.
public sealed class RemoteFileSystemStateChangedEventArgs : AsyncEventArgs
Public NotInheritable Class RemoteFileSystemStateChangedEventArgs
Inherits AsyncEventArgs
public ref class RemoteFileSystemStateChangedEventArgs : public AsyncEventArgs sealed
Show how to handle the StateChanged event.
using System;
using ComponentPro.IO;
using ComponentPro.Net;
...
static void Main()
{
// Create a new class instance.
Ftp client = new Ftp();
client.StateChanged += client_StateChanged;
// Connect to the FTP server.
client.Connect("localhost");
// Authenticate.
client.Authenticate("test", "test");
// ...
// Do something here
// ...
// Disconnect.
client.Disconnect();
}
static void client_StateChanged(object sender, RemoteFileSystemStateChangedEventArgs e)
{
Console.WriteLine("State changed, old state: {0}, new state: {1}", e.OldState, e.State);
}
Imports ComponentPro.IO
Imports ComponentPro.Net
...
Shared Sub Main()
' Create a new class instance.
Dim client As New Ftp()
AddHandler client.StateChanged, AddressOf client_StateChanged
' Connect to the FTP server.
client.Connect("localhost")
' Authenticate.
client.Authenticate("test", "test")
' ...
' Do something here
' ...
' Disconnect.
client.Disconnect()
End Sub
Private Shared Sub client_StateChanged(ByVal sender As Object, ByVal e As RemoteFileSystemStateChangedEventArgs)
Console.WriteLine("State changed, old state: {0}, new state: {1}", e.OldState, e.State)
End Sub
Show how to handle the StateChanged event.
using System;
using ComponentPro.IO;
using ComponentPro.Net;
...
public void HandleStateChangedEvent()
{
// Create a new class instance.
Sftp client = new Sftp();
client.StateChanged += client_StateChanged;
// Connect to the SFTP server.
client.Connect("localhost");
// Authenticate.
client.Authenticate("test", "test");
// ...
// Do something here
// ...
// Disconnect.
client.Disconnect();
}
void client_StateChanged(object sender, RemoteFileSystemStateChangedEventArgs e)
{
Console.WriteLine("State changed, old state: {0}, new state: {1}", e.OldState, e.State);
}
Imports ComponentPro.IO
Imports ComponentPro.Net
...
Public Sub HandleStateChangedEvent()
' Create a new class instance.
Dim client As New Sftp()
AddHandler client.StateChanged, AddressOf client_StateChanged
' Connect to the SFTP server.
client.Connect("localhost")
' Authenticate.
client.Authenticate("test", "test")
' ...
' Do something here
' ...
' Disconnect.
client.Disconnect()
End Sub
Private Sub client_StateChanged(ByVal sender As Object, ByVal e As RemoteFileSystemStateChangedEventArgs)
Console.WriteLine("State changed, old state: {0}, new state: {1}", e.OldState, e.State)
End Sub
ComponentPro.IO.ComponentPro.IO.RemoteFileSystemStateChangedEventArgs