0

我有客户端-服务器代码。在服务器运行后,我创建它来运行客户端:

        Process p = new Process();
        p.StartInfo.Arguments = "message";
        p.StartInfo.FileName = @"AsynchronousClientSocket.exe";
        p.Start();

此时客户端连接到服务器,现在我想向客户端 exe 发送一个参数以到达服务器并捕获服务器响应(int 值)我该怎么做?

4

2 回答 2

2

You need to look at something which allows interprocess communication.

You could host a WCF service inside the exe, and then talk to that from the other code using a service ref...

The database idea that someone else mentioned is ok, but it means you'll have to be continually polling for a change in the underlying value, creating extra load on your database server and causing your DBAs to come after you with dogs...

于 2013-09-13T15:47:33.530 回答
1

尝试这个:

Process p = new Process();
p.StartInfo.Arguments = "/myargument";
p.StartInfo.FileName = "myprogram.exe";
p.Start();
于 2013-09-13T15:12:11.273 回答