|
MessengerYouLike
|
|
When File is sending,number of Bytes sent are reurtrned
public event OnFileSendTransferring;
Public Event OnFileSendTransferring(ByVal FileTransferID As String, ByVal FileEncryption As Boolean, ByVal FriendUsername As String, ByVal FileName As String, ByVal BytesSent As Long, ByVal TotalBytesToSent As Long)
|
Return Values |
Description |
|
ByVal FileTransferID As String |
ID of File Transfer |
|
ByVal FileEncryption As Boolean |
File Encryption Enabled or not enabled |
|
ByVal FriendUsername As String |
Username of the Sender |
|
ByVal FileName As String |
Name of the file Being received |
|
ByVal BytesSent As Long |
Bytes Sent |
|
ByVal TotalBytesToSent As Long |
Total Number of Bytes that Will be Sent |
This Event is Used to Monitor the progress of File Transfer on sender IMClient
[Visual Basic] 'Create a new IMClient Dim MC as new IMSDK.IMClient 'Call the Listen Sub MC.Listen() 'Now Try to login MC.BeginLogin(TxtUsername.Text,TxtPassword.Text) 'if username and password is valid then Private Sub MC_OnLoggedin(ByVal UserObject As IMSDK.User) Handles MC.OnLoggedin Debug.WriteLine("Username logged in : " & MCUser.Username & " , " & MCUser.Password) End Sub 'if username or password is invalid then Private Sub MC_OnUsernameOrPasswordInvalid(ByVal Username As String, ByVal Password As String) Handles MC.OnUsernameOrPasswordInvalid Debug.WriteLine("Username password invalid : " & Username & " , " & Password) End Sub 'Send File MC.BeginSendFile(TxtFilePath.Text, TxtFriendUsername.Text) 'if file transfer request accepted 'Progress can be monitored via these events Private Sub MC_OnFileSendTransferring(ByVal FileTransferID As String, ByVal FileEncryption As Boolean, ByVal FriendUsername As String, ByVal FileName As String, ByVal BytesSent As Long, ByVal TotalBytesToSent As Long) Handles MC.OnFileSendTransferring Debug.WriteLine("On File Transferring - FriendUsername :" & FriendUsername & " FileName:" & FileName & " BytesSent:" & BytesSent & " TotalBytesToSent:" & TotalBytesToSent) End Sub Private Sub MC_OnFileSendComplete(ByVal FileTransferID As String, ByVal FriendUsername As String, ByVal FileName As String) Handles MC.OnFileSendComplete Debug.WriteLine("On File Send Complete - FriendUsername :" & FriendUsername & " FileName :" & FileName) End Sub 'if users Cancels the file transfer then Private Sub MC_OnFileSendCancelled(ByVal FileTransferID As String, ByVal FriendUsername As String, ByVal FileName As String) Handles MC.OnFileSendCancelled Debug.WriteLine("On File Cancelled - FileTransferID :" & FileTransferID & " FileName :" & FileName) End Sub 'After File transfer Completes or User Get Disconnected Private Sub MC_OnFileSendDisconnected(ByVal FileTransferID As String, ByVal FriendUsername As String, ByVal FileName As String) Handles MC.OnFileSendDisconnected Debug.WriteLine(" MC_OnFileSendDisconnected - FileTransferID: " & FileTransferID & " FriendUsername : " & FriendUsername & " FileName : " & FileName) End Sub 'if file Transfer Request is rejected then Private Sub MC_OnFileRequestRejected(ByVal FileTransferID As Object) Handles MC.OnFileRequestRejected Debug.WriteLine("File Request Rejected : " & FileTransferID) End Sub