|
-
Apr 24th, 2005, 05:59 PM
#1
Thread Starter
Lively Member
p2P Chat
How do I make a type of login screen. For example, I enter an ip address in a text box and I click connect. It connects to that Ip address I specified in the text box. And that person recives all messages i sent him. How can i do this?
Thanks,
Junior
Last edited by Spider-Freak; Apr 24th, 2005 at 06:11 PM.
-
Apr 24th, 2005, 06:59 PM
#2
Re: p2P Chat
its called winsock mate
-
Apr 24th, 2005, 07:58 PM
#3
Thread Starter
Lively Member
Re: p2P Chat
thought u guyz already knew im using Winsock =/... Um this is what i have so far:
VB Code:
'Client Form: Where I click type Ip and click connect:
Option Explicit
Private Sub cmdConnect_Click()
Winsock.Connect txtIP.Text, 42726
End Sub
Private Sub Form_Load()
Server.Show
Server.Hide
End Sub
Private Sub Winsock_Connect()
MsgBox "You're Now Connected To :" & txtIP
Server.Show
Client.Hide
txtIP.Text = ""
End Sub
Private Sub Winsock_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)
MsgBox "Error: " & Description
End Sub
'Server Form: Where the chat is placed:
Option Explicit
Private Sub cmdSend_Click()
Winsock.SendData txtChat.Text
DoEvents
txtMain.Text = txtMain.Text & vbNewLine & txtChat.Text
txtChat = ""
End Sub
Private Sub Form_Load()
Winsock.LocalPort = 42726
Winsock.Listen
End Sub
Private Sub Winsock_ConnectionRequest(ByVal RequestID As Long)
Winsock.Close
Winsock.Accept RequestID
End Sub
Private Sub Winsock_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
Winsock.GetData strData
txtMain = txtMain & vbNewLine & strData
txtMain.SelStart = Len(txtMain.Text)
End Sub
Hope this helps more....
-
Apr 25th, 2005, 05:03 PM
#4
Thread Starter
Lively Member
Re: p2P Chat
Anyone? Also, how do you make the chatbox popup on the other person's computer when I send a message?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|