|
-
Sep 17th, 2000, 10:04 PM
#1
Thread Starter
Hyperactive Member
Ok Can i use a winsock control and somehow get the information going through a port? Like for example I am useing AIM and it is useing prot 5910, say i want to know what is going through that port while aim is running, but I dont want to change the info going through it, i just want to look at it? Possable change it if i wanted to thought. Any ideas?
-
Sep 17th, 2000, 11:39 PM
#2
Well...
I am new to winsock as well so i might be wrong..but
This program will give you a idea of what you are asking.
this is the the first program i made wit winsock..it's a basic (veeeeryyyy basic) chat program.
This program was made with to separate projects open.
The client form:
Option Explicit
Private Sub Command1_Click()
On Error Resume Next
Winsock1.Connect "127.0.0.1", 1134
End Sub
Private Sub Command2_Click()
Dim Message As String
Message = Text1.Text
Winsock1.SendData Message
Text1.Text = ""
End Sub
Private Sub Form_Load()
End Sub
Private Sub Winsock1_Connect()
MsgBox "Yes!"
End Sub
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
If Winsock1.State <> sckConnected Then Winsock1.Close
Winsock1.Accept requestID
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim Client As String
Winsock1.GetData Client, vbString
Text1.Text = Client
End Sub
The server Form:
Private Sub Command1_Click()
Winsock1.SendData Text1.Text
End Sub
Private Sub Form_Load()
Winsock1.LocalPort = 1134
Winsock1.Listen
End Sub
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
If Winsock1.State <> sckConnected Then Winsock1.Close
Winsock1.Accept requestID
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim Message As String
Winsock1.GetData Message, vbString
Text1.Text = Message
End Sub
You can just copy and paste this code into your projects to get a basic idea.
There might be some errors in this code but i doubt it,
it's been so long since i used it.
Hope it werks for ya
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
|