VB.NET TUTORIALS: LOGIN NIMBUZZ OR ANY JABBER APPLICATION USING AGSXMPP
(PART1)
Hi Friends,On this topic i Decide to give You an Idea on how to make Your Own Nimbuzz
Software or any Jabber Application Step by Step (Using Agsxmpp in VB.NET)
Requirements:
Visual Basic 2010 or hiegher
Agsxmpp.dll
Net Framework ( Must Better youve Installed all Version )
Now you will have all requirements needed?
Now Lets Start.
Now Open the VB.NET and selcet New Project
3 label
3 textbox
2 button
1 listbox
for the label1 text,type = Username
for label2 text type = Password
for label3 text type = Resource
for the 3 textbox,
textbox1 rename it to txtuser
textbox2 rename it to txtpassword
textbox3 rename it to txtresource
now for listbox, rename it to listEvents
and
for the 2 button,1 for login and 1 for logout
- Imports System
- Imports System.Drawing
- Imports System.Collections
- Imports System.ComponentModel
- Imports System.Windows.Forms
- Imports System.Data
- Imports agsXMPP
- Imports agsXMPP.protocol
- Imports agsXMPP.protocol.iq
- Imports agsXMPP.protocol.iq.disco
- Imports agsXMPP.protocol.iq.roster
- Imports agsXMPP.protocol.client
- Imports agsXMPP.Xml.Dom
- Now adding other codes,
- Inherits Form
- Private reu As New XmppClientConnection()
- Public Sub New()
- InitializeComponent() Init()
- End Sub
- Private Sub Init()
- listEvents.Items.Clear()
- AddHandler reu.OnLogin, New ObjectHandler(AddressOf reu_OnLogin) AddHandler reu.OnAuthError, New XmppElementHandler(AddressOf reu_OnAuthError)
- AddHandler reu.OnClose, New ObjectHandler(AddressOf reu_OnClose)
- End
- Sub Private Sub reu_OnClose(sender As Object)
- If InvokeRequired Then BeginInvoke(New ObjectHandler(AddressOf reu_OnClose), New Object() {sender})
- Return
- End If
- listEvents.Items.Add("OnClose Connection closed")
- listEvents.SelectedIndex = listEvents.Items.Count - 1
- End Sub
- Private Sub reu_OnAuthError(sender As Object, e As agsXMPP.Xml.Dom.Element) If InvokeRequired Then BeginInvoke(New XmppElementHandler(AddressOf reu_OnAuthError), New Object() {sender, e})
- Return
- End If
- listEvents.Items.Add("OnAuthError")
- listEvents.SelectedIndex = listEvents.Items.Count - 1
- End Sub
- Private Sub reu_OnLogin(sender As Object) If InvokeRequired Then BeginInvoke(New ObjectHandler(AddressOf reu_OnLogin), New Object() {sender}) Return
- End If
- listEvents.Items.Add("OnLogin") listEvents.SelectedIndex = listEvents.Items.Count - 1
- MsgBox(" Online ", MsgBoxStyle.Information)
- End Sub
add this codes on the Public Class Form below.
looks like this.
- Dim jidUser As New Jid(txtuser.Text)
- reu.Username = jidUser.User
- reu.Server = jidUser.Server
- reu.Password = txtpassword.Text
- reu.Resource = txtresource.Text
- reu.AutoResolveConnectServer = True
- reu.Open()
after adding codes for login button,back to form design and double click the logout button and add this codes:
reu.Close()
and now your first software is finish..
you can put name of your software here,look on image.
click only the application form and go to properties and select text and change what name you want.
and now,we will test the software,i will use nimbuzz server and gmail account,but the first thing i forget, in your password textbox,you will need to add some sign to hide the real password leter. see the image on how. in passwordschar i add #
No comments:
Post a Comment