Ok this is client - server based using Winsock. Here is what I have.
This is the client sending the data to server:
VB Code:
Private Sub Command5_Click()
Dim msgee As String
msgee = "GI"
Winsock2.SendData msgee
Exit Sub
End Sub
This is the Server Receiving the data:
VB Code:
Private Sub winsock1_DataArrival _
(ByVal bytesTotal As Long)
Dim strData As String
Winsock1.GetData strData
If strData = "GI" Then
Dim info As String
info = "Test"
Winsock1.SendData info
Exit Sub
End If
End Sub
This is the client receiving the data from the server:
VB Code:
Private Sub winsock1_DataArrival _
(ByVal bytesTotal As Long)
Dim strData As String
Winsock1.GetData strData
Text1.Text = strData
End Sub
Well it looks good except it is not working. When I click the command button in the first code, it shoud send the data to the server. Then the server will recieve the data and check if it is "GI". If it is then, it will create a variable with the text "Test" in it, and send it back to the client. Then whatever the client recieves back from the server will be placed in text1.text. Except nothing appears. I have gone through about 3 times and can't figure out whats wrong. Probably something simple, but im not sure. Can anyone help?
Last edited by Inuyasha1782; Jun 3rd, 2005 at 05:47 PM.
Age - 15 ::: Level - Advanced
If you find my post useful please ::Rate It::
Alright one more question thats related to this. How do I put what ever is in a text file into a variable so I can send it to the client and display it there. So it would go like this:
1. The Client sends the trigger to the server
2. The server reads the trigger, and then sets a variable to a text file say something like "C:\Test.txt"
3. The variable is sent over to the the client, and the client displays the the text in the text document that was in the variable.
Does anyone know how to do that?
Age - 15 ::: Level - Advanced
If you find my post useful please ::Rate It::
Alright so if I were to recieve the data, and place it in another variable and then used something like Text1.text = "Variable the contents of the text file would be displayed?
Age - 15 ::: Level - Advanced
If you find my post useful please ::Rate It::
One more thing. Some files are not really text files, but can be displayed as one using like Notepad. Would this way have the same effect? So like say I open a file thats a .dll. Windows automatically asks what I want to open this file in. I select Notepad and it displays to me the contents of the dll in code form. Will this way have the same result? Or mabye when I got it I could shell notepad to display the code for me?
Age - 15 ::: Level - Advanced
If you find my post useful please ::Rate It::