Click to See Complete Forum and Search --> : setting up a client/server program
OmegaZero
Jan 10th, 2001, 10:49 PM
Does anyone know how to set up a program so that the program on the server sends a message to the client computer that will activate another program. I already have the program set up on the client computer, but I don't know how to get the server to send the message for the program on the client computer to begin. anybody?? Thanks!
:)
plenderj
Jan 11th, 2001, 06:46 AM
Well, you just have to tell the client what to run.
Server Side :
Private Sub Command1_Click()
If (Text1.Text <> "") Then
Winsock1.SendData "runapp:" & Text1.Text
Else
MsgBox "Please enter an application for client"
End If
End Sub
Client Side :
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim var_sockdata As String
Winsock1.GetData var_sockdata, vbString
If (Left(var_sockdata, 7) = "runapp:") Then
Shell Mid(var_sockdata, 8), vbNormalFocus
End If
End Sub
Hope it helps.
- jamie
OmegaZero
Jan 11th, 2001, 11:03 AM
with any network computer? I need it to specify a certain computer. Also, when I tried that code it said object required....do I have to set up the winsock or anything else? or is this code just suppose to do the trick by itself (it's the only code in the project)
plenderj
Jan 11th, 2001, 11:20 AM
Well,
Text1 needs to be a textbox whose text property = the full path to the application the client is to run
Winsock1 is a winsock control on a form on both the client and server side of things.
- jamie.
OmegaZero
Jan 11th, 2001, 12:41 PM
I know that text 1 needs to have the full path of the program in it, but I don't know how to set up the winsock control.. I guess thats my question. Can you help me with this? :)
plenderj
Jan 12th, 2001, 01:53 AM
Okay,
In VB, goto the Project Menu (across the top of the screen).
Select Components.
Scroll down the list until you come to something like ;
Microsoft Winsock Control
Make sure its box is ticked.
Then do Apply.
Exit from that screen.
The winsock control should now be on the toolbox.
Select it and drag it onto a form.
Need to know more ?
- jamie
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.