|
-
Jan 10th, 2001, 11:49 PM
#1
Thread Starter
Member
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!
-
Jan 11th, 2001, 07:46 AM
#2
Retired VBF Adm1nistrator
Well, you just have to tell the client what to run.
Server Side :
Code:
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 :
Code:
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
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Jan 11th, 2001, 12:03 PM
#3
Thread Starter
Member
will this work....
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)
-
Jan 11th, 2001, 12:20 PM
#4
Retired VBF Adm1nistrator
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.
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Jan 11th, 2001, 01:41 PM
#5
Thread Starter
Member
ok...
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?
-
Jan 12th, 2001, 02:53 AM
#6
Retired VBF Adm1nistrator
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
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|