andrea_deleon Level: Guest

|
Re: Username and Password with winsock
If I'm going to do it, I'll include a code in every message I send between client and server. So, for every message I receive, I'll take the code first to determine what this data (message) is all about.
If I'm going to do it, I'll do it something like...
' Client program precedes username code "#uname" to the actual username data and send the message to the server.
StrData = "#uname" & txtIDNumber.Text
' sending password...
StrData = "#pword" & txtPassword.Text
'At the server side, all the messages received by the server will be checked first to determine the received message...
'assuming all codes are of 6 bytes, remove the first 6 bytes from the message and store it to, say, vMyCode, and ...
select case vMyCode ' use if statement if this usage is wrong
case "#uname": 'process username received
case "#pword": 'process password received
case "#adata": 'process data
Or maybe, for data, there will be no code hence first letter of message received/sent has no # sign. Only messages for command and synchronization (software side) will have a code and data wouldn't.
I'm not very good in winsock. For the "experts", please give a guide on how to do this properly.
|