none
Client / Server Program

    Question

  • Ok well I want to create a server sided program.. (Runs on a dedicated server)
    and a client sided program (runs on the client's computer)

    And the two programs can communicate send commands and so on.

    Is this possible in VC# 2008? And if so how could I do it?
    Thanks in advanced.
    14 Yr Old C# Programmer.
    Thursday, May 28, 2009 1:17 AM

Answers

  • Frank,

    Interesting developing is 10% learning 20% searching on Internet and 70% bug solving.

    Because of your age, I would not be the one who helps you in a direction that you are only a copier and paster as the non professionals are called.

    Cor

    • Proposed as answer by Cor LigthertMVP Saturday, May 30, 2009 7:09 AM
    • Marked as answer by Roahn Luo Monday, June 01, 2009 11:54 AM
    Saturday, May 30, 2009 7:08 AM

All replies

  • try these links for sample tutorial
    http://www.codeproject.com/KB/IP/socketsByBobJanova.aspx
    http://www.codeproject.com/KB/IP/tcpclientserver.aspx
    kaymaf


    I hope this helps, if that is what you want, just mark it as answer so that we can move on
    • Proposed as answer by Wyck Monday, June 01, 2009 5:45 PM
    Thursday, May 28, 2009 2:30 AM
  • You may also want to take a look at WCF:

    http://msdn.microsoft.com/en-us/library/ms731082.aspx

    http://msdn.microsoft.com/en-us/netframework/aa663324.aspx

    This is another way for a client and server application to communicate.

    Hope this helps.

    www.insteptech.com
    We are volunteers and ask only that if we are able to help you, that you mark our reply as your answer. THANKS!
    Thursday, May 28, 2009 2:49 AM
  • try these links for sample tutorial
    http://www.codeproject.com/KB/IP/socketsByBobJanova.aspx
    http://www.codeproject.com/KB/IP/tcpclientserver.aspx
    kaymaf


    I hope this helps, if that is what you want, just mark it as answer so that we can move on

    Thanks but is this how I would like be able to open a program on the dedi from the client?
    14 Yr Old C# Programmer.
    Thursday, May 28, 2009 2:53 AM
  • may you please help me out? and how would I do this on a non console based program, i want ot do this on a windows form.
    14 Yr Old C# Programmer.
    Saturday, May 30, 2009 6:22 AM
  • Frank,

    Interesting developing is 10% learning 20% searching on Internet and 70% bug solving.

    Because of your age, I would not be the one who helps you in a direction that you are only a copier and paster as the non professionals are called.

    Cor

    • Proposed as answer by Cor LigthertMVP Saturday, May 30, 2009 7:09 AM
    • Marked as answer by Roahn Luo Monday, June 01, 2009 11:54 AM
    Saturday, May 30, 2009 7:08 AM
  • I would just like a method in doing this..


    14 Yr Old C# Programmer.
    Saturday, May 30, 2009 7:45 AM
  • well i go the connection method alreeady but i don't know how to open up a program if u press a button on the client it opens on the server.
    14 Yr Old C# Programmer.
    Monday, June 01, 2009 3:16 PM
  • I don't think you want to open a program on the server from the client.  You start the server program running first, and it listens for connections originating from the client computer.  Then after the server is running, you run the client program.  The client program connects to the server program and they establish a connection.   Then they can pass messages back and forth on this connection.

    It's similar to games, where the server has to be running first, then clients connect to the server.

    The tcpclientserver sample provided by kaymaf is really the right answer here.   http://www.codeproject.com/KB/IP/tcpclientserver.aspx

    The code in the Main functions of the sample code could easily be lifted out and put into the button_Click handler or form_Load handler for a windows forms app.
    Monday, June 01, 2009 5:55 PM
  • I guess you don't undertsand. I DO want to start a program from the client. Like a server restarter.


    14 Yr Old C# Programmer.
    Monday, June 01, 2009 7:58 PM
  • Then you still need a client and server like Wyck explained. You will need a server listening for connections, then the client can connect and send the server messages. If you want, the server can then run programs using Process: http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx
    Monday, June 01, 2009 8:12 PM
  • As I said I already have the server and client working but i want to be able to press a button on the client side and it opens a program on the server side.


    14 Yr Old C# Programmer.
    Monday, June 01, 2009 10:09 PM
  • http://www.google.ca/search?hl=en&q=c%23+open+a+program&meta=&aq=f&oq=

    The first link works, you'll just have to use the full path instead of just "notepad.exe" if it's your own program.
    Tuesday, June 02, 2009 2:50 PM