Help about Winsock-DataArrival Events
Hello friends.
I am creating a client application which logs in other server using Username and password. Well i have done everything. The part i am stucked in is the Soket_DataArivval. This is the code:
Code:
Public Sub Soket_DataArrival(ByVal bytesTotal As Long)
Dim a As String
Dim Yash As String
Soket.GetData DatIn, vbString
a = Left(DatIn, 4)
a = Asciitohex(a)
Yash = Replace(DatIn, vbNullChar, " ")
If InStr(Yash, "Login failed - Username and password do not match") <> 0 Then
Soket_Close
Soket_Connect
Sts.Text = "Login failed. Username and password does not match."
End If
If a = "2 0 C9 0" Then
HashProc
End If
If a = "2 0 CB 0" Or a = "2 1 A6 0"
Then
GoodCode
End If
If a = "2 0 0 0" Then
BadCode
End If
If a = "2 2 C4 0" Then
End If
End Sub
Well what i am looking for is, i want if some hex data receives after logged in successful , like using wpe pro i have recorded hex data for example "Goths". Its packets are here:
Code:
0000 47 6F 74 68 73 Goths
I tried inserting its code in data arrival for example as this :
Code:
If a = "7 F 74 8" Then
MsgBox "got it"
End If
But it didnt work. I dont know what i have to do to make it done Friends.
I dont know If i am using the right way of hex data. I have tried using
Code:
If InStr(Yash, "Goths") <> 0 Then
MsgBox "MatchText"
End If
and it worked. But i dont want it that way.
2nd help i need is, as i have pressed login button and it has been logged in, i have started timer with interval of 1000 with the Form1_Load() and i want if some hex receives like "Goths" same example, then it set the Speed or resolution of running timer as it is, Because new text receives almost every second = 1000ms.
Please help me to sort out these things. Instant Help will be very much appreciated.
Regards,
n0dy