You are here: MessengerYouLike.IMSDK > IMSDK Reference > IMSDK Namespace > Classes > IMClient Class > IMClient Methods > IMClient.BeginLogOut Method
MessengerYouLike
IMClient.BeginLogOut Method

This Method Allows Users to Logout

C#
public BeginLogOut(String Username);
Visual Basic
Public Sub BeginLogOut(ByVal Username As String)
Parameters 
Description 
ByVal Username As String 
Username of the User To be Logged out 

When User Is Logged out Then all resources use by the user are Released and all friends are notified that Contact is offline

[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 : " & UserObject.Username & " , " & UserObject.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
 
 
 
'Logout User
   MC.BeginLogOut(UserObject.Username)
 
 
 
 
'When Completes Event Fires
    Private Sub MC_OnLoggedOut(ByVal Username As String, ByVal Time As String) Handles MC.OnLoggedOut
       Debug.WriteLine("User Logged Out")
    End Sub
 
 
 
'Stop The MC To Listen
   MC.StopListening()
 

 

Copyright (c) 2007. All rights reserved.