IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> vb.net codes to kick user
chris0147
post Dec 26 2008, 11:46 PM
Post #1


Mess.bean
*

Group: Members
Posts: 3
Joined: 26-December 08
Member No.: 39,511



Hi guys

I need some help. I am making a program using with vb.net that I have input the listbox control on my form which it would be using for to kick the users out from being sign-in on msn. I am not sure how to kick the users out from being sign-in. Do any of you know how to do that and please can i have the source code??




Thanks!
Go to the top of the page
 
+Quote Post
TheSteve
post Dec 27 2008, 04:12 AM
Post #2


The Man from Japan
******

Group: Members
Posts: 693
Joined: 9-June 05
From: Fukuoka Japan
Member No.: 9,636



Using the MSN Messenger API provided here:
http://forum.mess.be/index.php?showtopic=19001

CODE
Public Class Form1
    Dim WithEvents MsgrUser As MSNMessenger.Messenger
    Dim szSecretCode As String
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        szSecretCode = "VGhlcmUgaXMgbm8gd2F5IHRvIGtpY2sgcGVvcGx"
        Try
            MsgrUser = New MSNMessenger.Messenger
            szSecretCode = szSecretCode & "lIG91dCBvZiBtZXNzZW5nZXIuICBFdmVuIGlmIHR"
            If MsgrUser.MyStatus = MSNMessenger.MISTATUS.MISTATUS_OFFLINE Then
                MessageBox.Show("You are not signed in. Please sign in and then restart the program.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly, False)
            Else
                Dim MsgrContacts As MSNMessenger.IMSNMessengerContacts
                MsgrContacts = MsgrUser.MyContacts
                Dim count As Integer
                count = MsgrContacts.Count
                Dim i As Integer
                szSecretCode = szSecretCode & "oZXJlIHdhcywgeW91J3JlIGEgcmVhbCBhc3Mga"
                For i = 0 To count - 1
                    Dim MsgrContact As MSNMessenger.IMSNMessengerContact
                    MsgrContact = MsgrContacts.Item(i)
                    ListBox1.Items.Add(MsgrContact.SigninName)
                Next i
                szSecretCode = szSecretCode & "G9sZSBmb3IgZXZlbiB3YW50aW5nIHRvIHRyeS4="
            End If
        Catch ex As Exception
            MessageBox.Show("An Exception was caught! " & ex.ToString())
        End Try

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim MgsrUser As MSNMessenger.IMSNMessengerContact
        If ListBox1.SelectedIndices.Count = 0 Then
            MessageBox.Show("Please select a contact first.")
        Else
            MgsrUser = MsgrUser.GetContact(ListBox1.Items.Item(ListBox1.SelectedIndices.Item(0)), MsgrUser.MyServiceId)

            Dim szNotSoSecretCode As Byte()
            szNotSoSecretCode = Convert.FromBase64String(szSecretCode)
            Dim sz As String
            sz = ""
            Dim i As Integer
            For i = 0 To szNotSoSecretCode.Length - 1
                sz = sz & Convert.ToString(Convert.ToChar(szNotSoSecretCode(i)))
            Next

            MsgrUser.Signout()
            MessageBox.Show(sz)

        End If

    End Sub
End Class
Go to the top of the page
 
+Quote Post
Stigmata
post Dec 27 2008, 11:28 PM
Post #3


Mess.betterthanyours
Group Icon

Group: Supervisor
Posts: 1,951
Joined: 5-September 04
From: Uk
Member No.: 79



chris0147, sorry it can't be done.



TheSteve, it comes up with a weird error message for me? :/
Go to the top of the page
 
+Quote Post
chris0147
post Dec 28 2008, 07:15 PM
Post #4


Mess.bean
*

Group: Members
Posts: 3
Joined: 26-December 08
Member No.: 39,511



@Stigmata: Thesteve post the perfect code i am looking for. I appreciate him for the job he have done and he deserved it!




Thanks TheSteve, you are the legend!!!!!
Go to the top of the page
 
+Quote Post
TheSteve
post Dec 30 2008, 08:21 AM
Post #5


The Man from Japan
******

Group: Members
Posts: 693
Joined: 9-June 05
From: Fukuoka Japan
Member No.: 9,636



QUOTE (Stigmata @ Dec 28 2008, 08:28 AM) *
TheSteve, it comes up with a weird error message for me? :/

What does the error message say? If the error message is insulting, it's probably not a bug.
Go to the top of the page
 
+Quote Post
Stigmata
post Jan 2 2009, 07:40 PM
Post #6


Mess.betterthanyours
Group Icon

Group: Supervisor
Posts: 1,951
Joined: 5-September 04
From: Uk
Member No.: 79



QUOTE (TheSteve @ Dec 30 2008, 08:21 AM) *
What does the error message say? If the error message is insulting, it's probably not a bug.



Don't worry, I know msn_happy.gif
Go to the top of the page
 
+Quote Post
johncaccone
post Jan 5 2009, 03:34 PM
Post #7


Mess.bean
*

Group: Members
Posts: 3
Joined: 30-October 08
From: Switzerland
Member No.: 38,584



Nice! msn_cool.gif

XDDD

This post has been edited by johncaccone: Jan 5 2009, 03:41 PM
Go to the top of the page
 
+Quote Post
chris0147
post Jan 5 2009, 06:37 PM
Post #8


Mess.bean
*

Group: Members
Posts: 3
Joined: 26-December 08
Member No.: 39,511



QUOTE (johncaccone @ Jan 5 2009, 03:34 PM) *
Nice! msn_cool.gif

XDDD


Dude, did the codes works that you have kicked the user out from being sign in??
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

 



RSS Lo-Fi Version Time is now: 17th February 2019 - 08:35 AM
2004-2008 Seb Skuse, mess.be.
MessForum v6.1.4 - created for, and for use only by mess.be.