PowerTCP FTP for .NET
Log Event
Example 



Raised when data is read or written.
Syntax
Public Event Log As EventHandler(Of DataEventArgs)
Dim instance As TcpBase
Dim handler As EventHandler(Of DataEventArgs)
 
AddHandler instance.Log, handler
public event EventHandler<DataEventArgs> Log
public:
event EventHandler<DataEventArgs^>^ Log
Event Data

The event handler receives an argument of type DataEventArgs containing data related to this event. The following DataEventArgs properties provide information specific to this event.

PropertyDescription
Data Gets data provided by Data and Log events.  
Message Returns the message argument provided by the Marshal method. (Inherited from Dart.Ftp.UserStateEventArgs)
UserState Returns the user state argument provided by the Marshal method. (Inherited from Dart.Ftp.UserStateEventArgs)
Remarks
The handler must be added before connecting. See the SynchronizingObject property for information on updating UI controls in your event handler.
Example
This example demonstrates logging sent and received data to a textbox.
private void myComponent_Log(object sender, DataEventArgs e)
{
    string prompt = (e.Data.Direction == DataDirection.In) ? "Recv: " : "Sent: ";
    textBox1.AppendText(prompt + e.Data.ToString() + Environment.NewLine);
}
Private Sub myComponent_Log(ByVal sender As Object, ByVal e As DataEventArgs)
    Dim prompt As String = If(e.Data.Direction = DataDirection.In, "Recv: ", "Sent: ")
    textBox1.AppendText(prompt & e.Data.ToString() & Environment.NewLine)
End Sub
See Also

Reference

TcpBase Class
TcpBase Members


PowerTCP FTP for .NET Documentation Version 6.1
© 2023 Dart Communications. All Rights Reserved.
Send comments on this topic