TOTALLY EVILINSIDEZZ...
 
HomeCalendarFAQSearchMemberlistUsergroupsRegisterLog in

Share | 
 

 how to create a simple chatting application in visual basic..

View previous topic View next topic Go down 
AuthorMessage
Admin
Admin
Admin
avatar

Posts : 44
Join date : 2010-09-20
Age : 28
Location : mumbai

PostSubject: how to create a simple chatting application in visual basic..   Tue Sep 21, 2010 10:25 am

==============================================================================================
SIMPLE VISUAL BASIC CHATTING APPLICATION BY EVILSOFTS
==============================================================================================

Its very simple to create a chatting application in visual basic if u knws just basic factors and use of controls in visual basic 6.0
here u have to create a "CLIENT" and "SERVER"...where 'client' will work as a chatting application / messenger and 'server' willl perform the sending of "PACKETS" or transaction of data from one client to another one lol!

==============================================================================================
REQUIREMENT : visual basic 6.0 (microsoft winsock control*)
==============================================================================================
we will go systematically...
first let us create a 'CLIENT' Cool
In 'client' we need 'IP' and 'PORT', where this both will be the address of 'SERVER' on which the client is connected to perform chat...Twisted Evil


Here 'IP' is > 127.0.0.1
'PORT' is > 123
=============================================================================================
CLIENT CODING :-
=============================================================================================

CODE of 'CONNECT' button Arrow
Private Sub cmdconnect_Click()
On Error GoTo t
sock1.Close
sock1.RemoteHost = txtIP
sock1.RemotePort = txtPort
sock1.Connect
Exit Sub
t:
MsgBox "Error : " & Err.Description, vbCritical
End Sub
=============================================================================================

CODE of 'WINSOCK' controlArrow
Private Sub winsock1_Close()
winsock1.Close 'close connection
txtLog = txtLog & "*** Disconnected" & vbCrLf
End Sub

Private Sub winsock1_Connect()
txtLog = "Connected to " & winsock1.RemoteHostIP & vbCrLf
End Sub

Private Sub winsock1_DataArrival(ByVal bytesTotal As Long)
Dim dat As String
winsock1.GetData dat, vbString
txtLog = txtLog & "Server : " & dat & vbCrLf
End Sub

Private Sub winsock1_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
txtLog = txtLog & "*** Error : " & Description & vbCrLf
winsock1_Close
End Sub
============================================================================================= 
CODE of 'SEND' button Arrow
Private Sub cmdsend_Click()
On Error GoTo t
winsock1.SendData txtSend
txtLog = txtLog & "Client : " & txtSend & vbCrLf
txtSend = ""
Exit Sub
t:
MsgBox "Error : " & Err.Description
winsock1_Close
End Sub
=============================================================================================
** CLIENT CODING ENDS HERE **

=============================================================================================
Basketball lets move towards 'SERVER' coding...
=============================================================================================
SERVER CODING :-



=============================================================================================

CODE for 'LISTEN' button :-
Private Sub cmdListen_Click()
On Error GoTo t
winsock1.Close 'we close it in case it listening before
winsock1.LocalPort = txtPort
winsock1.Listen
Exit Sub
t:
MsgBox "Error : " & Err.Description, vbCritical
End Sub
=============================================================================================

CODE for 'SEND' button :-
Private Sub cmdsend_Click()
On Error GoTo t
winsock1.SendData txtSend
txtLog = txtLog & "Server : " & txtSend & vbCrLf
txtSend = ""
Exit Sub
t:
MsgBox "Error : " & Err.Description
winsock1_Close
End Sub
=============================================================================================

CODE for 'WINSOCK' controls :-
Private Sub winsock1_Close()
winsock1.Close
txtLog = txtLog & "*** Disconnected" & vbCrLf
End Sub

Private Sub winsock1_ConnectionRequest(ByVal requestID As Long)
'txtLog is the textbox used as our
If winsock1.State <> sckClosed Then winsock1.Close
winsock1.Accept requestID
txtLog = "Client Connected. IP : " & winsock1.RemoteHostIP & vbCrLf
End Sub

Private Sub winsock1_DataArrival(ByVal bytesTotal As Long)
Dim dat As String
sock1.GetData dat, vbString
txtLog = txtLog & "Client : " & dat & vbCrLf
End Sub

Private Sub winsock1_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
txtLog = txtLog & "*** Error : " & Description & vbCrLf
winsock1_Close
End Sub
=============================================================================================
server coding ends here Wink Wink

=============================================================================================

ENJOY THIS CODE AND MAKE UR OWN CHATTING APPLICATION...THIS IS JUST A SIMPLE APPLICATION... SOON I WILL SHARE A MULTI CHATTING SOFTWARE CODE Wink Wink Twisted Evil

EVILSOFTS RULZZZZ Twisted Evil
Back to top Go down
View user profile http://evilsofts.forum777.com
goldy

avatar

Posts : 18
Join date : 2010-10-03
Age : 27
Location : mumbai

PostSubject: Re: how to create a simple chatting application in visual basic..   Thu Oct 14, 2010 1:02 pm

thanks sir.ji i will try:D
Back to top Go down
View user profile
assasaha



Posts : 3
Join date : 2012-07-18

PostSubject: Re: how to create a simple chatting application in visual basic..   Wed Jul 18, 2012 12:44 pm

Embarassed
Back to top Go down
View user profile
Sponsored content




PostSubject: Re: how to create a simple chatting application in visual basic..   

Back to top Go down
 
how to create a simple chatting application in visual basic..
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» Beto's application
» death knight application ( blood elf)
» CREATE a new battlenet account?
» DETH application
» Looking for someone to create a logo...

Permissions in this forum:You cannot reply to topics in this forum
EVILSOFTS... :: PROJECTS-
Jump to: