1 Attachment(s)
Client/Server Changing Password feature
Hi..
I want to add a change password feature to my client/server application using TCP.
Normally, the change password feature has "Old Password", "New Password" and "Confirm Password" rite..?
That means I need 3 text box and will be sending 3 different data at the same time..
When sending only 1 data, for example, sending a data from client to server and put that data in a text box, that I know how to do.
But when there are 3 different data sent at the same time from client to the server with 3 different text box to hold the data, how to make sure that the data go into the right text box in the server..?
Below is the code that I have done.. It only send 1 data..
The whole project is also attached below..
Code:
'Server
Private Sub Form_Load()
Form1.Visible = True
Do
If Winsock1.State <> sckConnected And Winsock1.State <> sckListening Then
Winsock1.Close
Winsock1.LocalPort = Text1.Text
Winsock1.Listen
End If
DoEvents
Loop
End Sub
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
Winsock1.Close
Winsock1.Accept requestID
Me.Caption = "Connection From: " & Winsock1.RemoteHostIP & " Accepted."
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim Data As String
Winsock1.GetData Data
Text2.Text = Data
If Data = "END" Then End
End Sub
'Client
Private Sub Command1_Click()
On Error Resume Next
Winsock1.Close
Winsock1.RemoteHost = Text1.Text
Winsock1.RemotePort = Text2.Text
Winsock1.Connect
End Sub
Private Sub Command2_Click()
Winsock1.Close
Me.Caption = "Connection Closed."
End Sub
Private Sub Command3_Click()
If Winsock1.State <> sckConnected Then Exit Sub
Winsock1.SendData Text3.Text
End Sub
Private Sub Command4_Click()
If Winsock1.State <> sckConnected Then Exit Sub
Winsock1.SendData "END"
End Sub
Re: Client/Server Changing Password feature
Concatenate your 3 text into 1 with any seperator (e.g ',-.) and do the reverse at the server side.
Example:
text3.text = oldpwd.text+","newpwd.text","newpwd2.text"
send text3.text to server and split text3.text at server side.
Umar
Re: Client/Server Changing Password feature
Quote:
Originally Posted by umararif
Concatenate your 3 text into 1 with any seperator (e.g ',-.) and do the reverse at the server side.
Example:
text3.text = oldpwd.text+","newpwd.text","newpwd2.text"
send text3.text to server and split text3.text at server side.
Umar
Thanks.. i think I understand what u mean.. but, how to I seperate the 3 infos fom text3 into 3 different text box when it reach the destination..?
1 Attachment(s)
Re: Client/Server Changing Password feature
You can use instr() and instrrev(), check attached project.
Umar