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

This Method Allows Users to Find IMSDK.Friends.MFriend for specific username

C#
public Friends.MFriend FindContactListFriend(String Username);
Visual Basic
Public Function FindContactListFriend(ByVal Username As String) As Friends.MFriend
Parameters 
Description 
ByVal Username As String 
Username of the Friend 

Supply Friend username and this method will return IMSDK.Friends.MFriend Object of the friend that holds all the properties of the friend

[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
 
 
 
'Find a Local Friend
    Dim ObjFri As IMSDK.Friends.MFriend = MC.FindContactListFriend(TxtuserName.Text)
Copyright (c) 2007. All rights reserved.