Jump to content

LAN instant messenger visual basic


Recommended Posts

I have been trying to create a basic instant messenger for a Local Area Network, but I can not figure out ware to start I found a method that work for VB 6 but I am using VB 2008 so the setup is not the same.

Private Sub cmdclose_Click()
sckMain.Close
txtlog = txtlog.Text & "Connection closed!" & vbCrLf
End Sub

Private Sub cmdConnect_Click()
sckMain.RemoteHost = txtip.Text
sckMain.RemotePort = txtport.Text
sckMain.Connect
End Sub

Private Sub cmdHost_Click()
sckMain.LocalPort = txtport.Text
sckMain.Listen
End Sub

Private Sub cmdsend_Click()
sckMain.SendData "[" & txtname.Text & "] " & txtsend.Text
txtlog = txtlog.Text & "[" & txtname & "] " & txtsend.Text & vbCrLf
txtsend.Text = ""
End Sub

Private Sub Command1_Click()
MsgBox ("Enter the host IP to connect Only 2 Peers can Talk at one time")
End Sub


Private Sub sckMain_ConnectionRequest(ByVal requestID As Long)
If sckMain.State <> sckClose Then
sckMain.Close
End If
sckMain.Accept requestID
txtlog = txtlog.Text & "Connected to: " & sckMain.RemoteHostIP & vbCrLf
End Sub

Private Sub sckMain_DataArrival(ByVal bytesTotal As Long)
Dim Data As String
sckMain.GetData Data, vbString
txtlog = txtlog.Text & Data & vbCrLf
End Sub

I there any way I can do this in VB Express 08?

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...