Tech Off Thread

5 posts

Fire a command from remote pc!

Back to Forum: Tech Off
  • User profile image
    chuawenching

    Hi there,

    I had a question.

    Just say I had 2 PCs.

    PC A:
    a window service called RemoteFireService is running behind. When PC A receive the command (example, "dir") from PC B, it will fire this command "dir" to PC B.


    PC B:
    a window service called RemoteGetCommandService is running behind. This service will get this current PC commands and call a web service (return a string) back to PC A.

    Okay, should i be using WMI to do this or Win32 API?

    I am using C#.NET, and I need some guidance. I know how to do web services and calling wmi remotely.

    Do i need to create my own telnet?

    Thanks.

  • User profile image
    Manip

    Open a listening socket.. opening a active socket.. connect A to B, send command.. receive, interpret. etc

    I think your over-complicating it. There is no need to dabble in the Win32 API for THIS project as that is all handled for you by .NET. And no, you don't need to make a new 'telnet', just handle strings well and don't forget about 13 + 10.

  • User profile image
    IceFreak2000

    If you're learning to develop .NET Remoting applications, I seriously reccommend getting hold of Ingo Rammer's excellent "Advanced .NET Remoting" book, in either the VB.NET or C# flavour.

  • User profile image
    chuawenching

    Thanks for the recommendation. I heard of Ingo Rammer from other friends.

    I can open a listening sockets in a window service? You sure?

  • User profile image
    Manip

    Yes. I'm sure. Windows services are the same as any standard windows executable except with a few added event handlers etc.

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.