PDA

Click to See Complete Forum and Search --> : Help Winsock Filter


VikingMan
Nov 14th, 2006, 04:48 PM
hI ive made a proxy and i wanted to make a filter how do I it?

Public Sub Winsock1_DataArrival()
Dim Data As Object
Dim rByte As Byte

Winsock1.GetData(Data)

If Data = ?? Then 'Filter Here
Msgbox(??.ToString)
End If

End Sub

the code above doesnt work I need some help..

DigiRev
Nov 14th, 2006, 06:59 PM
What are you trying to filter...?

And why are you declaring Data as an object?

Private Sub Winsock1_DataArrival()
Dim bytData() As Byte, strData As String

winsock1.GetData bytData()
'Convert data to string.
strData = StrConv(bytData(), vbUnicode)

If LCase$(Left$(strData, 4)) = "post" Then
'Ignore HTTP post...
End If

End Sub

VikingMan
Nov 14th, 2006, 07:32 PM
this is written in VB.NEt..need .Net code

the182guy
Nov 16th, 2006, 02:05 PM
the Winsock Control does not exist in vb.NET, you have to use the TCPClient and TCPListener calsses :(:(