0 Replies - 953 Views - Last Post: 07 September 2012 - 02:01 AM Rate Topic: -----

#1 karansingh  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 07-September 12

how to make nimbuzz login form in vb.net

Posted 07 September 2012 - 02:01 AM

hi friends, i am new in vb.net 2010.i wannna make nimbuzz login form,nimbuzz block xml,so i can`t login my software,so please any one help me :(


Imports System.Net
Public Class Form1

Private Sub login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles login.Click

Winsock.Connect()
Winsock.RemoteHost = "openfire.nimbuzz.com"
Winsock.RemotePort = 5222


End Sub


Private Sub Winsock_ConnectionRequest(ByVal sender As Object, ByVal e As AxMSWinsockLib.DMSWinsockControlEvents_ConnectionRequestEvent) Handles Winsock.ConnectionRequest

Winsock.Accept(e.requestID)
txtserver.Text = txtserver.Text & Winsock.RemoteHost & ":" & Winsock.RemotePort & " has connected."


End Sub

Private Sub Winsock_ConnectEvent(ByVal sender As Object, ByVal e As System.EventArgs) Handles Winsock.ConnectEvent

Winsock.SendData("<stream:stream to='nimbuzz.com' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>")

End Sub

Private Sub Winsock_DataArrival(ByVal bytesTotal As Long)
Dim data As String
Winsock.GetData(data)
data = Replace(data, """", "'")
If InStr(data, "<stream:features><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><compression xmlns='http://jabber.org/features/compress'><method>zlib</method></compression><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism></mechanisms><register xmlns='http://jabber.org/features/iq-register'/></stream:features>") Then

Winsock.SendData("<iq type='set' xml:lang='en' id='NLgn' to='nimbuzz.com'><query xmlns='jabber:iq:auth'><username>" & txtUserID.Text & "</username><password>" & txtPass.Text & "</password><resource>" & txtResource.Text & "-bawor" & "</resource></query></iq>")
End If

If InStr(data, "<iq type='result' from='nimbuzz.com' xml:lang='en' id='NLgn'/>") Then
MessageBox.Show("Logged in")
End If
If InStr(data, "<iq type='error' from='nimbuzz.com' xml:lang='en' id='NLgn'><query xmlns='jabber:iq:auth'><username>" & txtUserID.Text & "</username><password>" & txtPass.Text & "</password><resource>" & txtResource.Text & "-bawor" & "</resource></query><error code='401' type='auth'><not-authorized xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error></iq>") Then
MessageBox.Show("Loggin Failed")
End If
End Sub
End Class

Is This A Good Question/Topic? 0
  • +

Page 1 of 1