View Single Post
  #4   Spotlight this post!  
Unread 09-06-2004, 11:34
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Remote Program Execution in Visual Basic

I do not believe you can have the files execute w/o something running on the other end.

MSDN has plenty of info.

I specialize in VB 6.0 (not .NET), so what I say will mostly apply to that.

The Winsock control is probably the best way to do this. the Inet will work too, but is more geared for getting documents off the WWW. Both only come with Profesional and Enteprise Editions. I haven't actually done this yet, but I will try to give a simple tutorial based on the subs.

On the server:
  1. Set the LocalPort and Protocal properties to what ever.
    For each client:
  2. Set the RemoteHost, RemoteHostIP, and the RemotePort properties to the client.
  3. Call Connect to connect to the remote computer; Wait for the Connect event.
  4. Call SendData to tell the client go.
  5. Wait for the SendComplete event.
  6. If there is a response in ur packet format, wait for that.
  7. Call Close

On each client:
  1. Set the LocalPort and Protocal properties to what ever.
  2. Set the RemoteHost, RemoteHostIP, and the RemotePort properties to the server.
  3. Call Listen, wait for the ConnectionRequest event, then call Accept to connect.
  4. Wait for the DataArrival event.
  5. Call GetData to get the data, then parse it (own code).
  6. If there is a response in ur packet format, call SendData to send the response.
  7. Run the file.

I don't think Shell() runs bats, but if you add Shell32.dll to your references, you can use the Shell object to run anything. (Verbs)