CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2002
    Location
    Greece
    Posts
    42

    Run a program in another PC

    I have written a program that uses some dos commands or external programs to recieve, convert and decrypt or encrypt files. The (dos) program that encrypts or decrypts these files, uses a special card that exists only in a certain PC (here at work).
    The thing now, is that we can only run this program in this PC (in the computer room) and it's really cold there. So, we either have to wear more clothes, or run the program from another PC, through the network. Is that possible (and easy) and how could it be done?
    Thanks.
    Visit www.greekroms.net

    Greek translations of roms

  2. #2
    Join Date
    Dec 2003
    Location
    Northern Ireland
    Posts
    1,362

    Re: Run a program in another PC

    I think you'd need a winsock control.. Something like:
    Code:
    ' using udp (connectionless protocol)
    Private Sub Form_Load()
        ' Set winsock properties
        Winsock1.Protocol = sckUDPProtocol
        Winsock1.RemoteHost = "RemoteComputer"  ' Remote computer name
        Winsock1.RemotePort = "12345"
        Winsock1.LocalPort = "12345"
        Winsock1.Bind 12345         ' Bind to localport so no other application can use.
    End Sub
    
    Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
        Dim strData As String
        Winsock1.GetData strData
        If Shell(strData) = 0 Then
            Winsock1.SendData "Unable to execute " & strData
        End If
    End Sub
    This is only 1 program, you need to also write one that will connect to this program (running on your remote pc in the warm room). This should get ya started though. Good luck!
    Last edited by HairyMonkeyMan; November 23rd, 2004 at 06:38 AM.

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

Featured