Results 1 to 6 of 6

Thread: setting up a client/server program

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2001
    Posts
    34

    Exclamation

    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!

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    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]

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2001
    Posts
    34

    Question 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)

  4. #4
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    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]

  5. #5

    Thread Starter
    Member
    Join Date
    Jan 2001
    Posts
    34

    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?

  6. #6
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    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
  •  



Click Here to Expand Forum to Full Width