C#窗体中的回调 [英] Callbacks in C# windows forms
本文介绍了C#窗体中的回调的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
HI,
我使用c#windows窗体在客户端 - 服务器应用程序中实现回调。
这里,客户端需要执行服务器方法。然后服务器方法应该有从1到20迭代的任何循环
,并且应该为每次迭代向客户端发送状态消息(类似于迭代的值)。我尝试使用回调但是失败了。
任何人都可以建议这个场景的解决方案。
谢谢提前。
Pavan。
Iam implementing a callback in client-server application using c# windows forms.
Here, the client needs to execute a server method. Then the server method should have any loop
iterating from 1 to 20 and should send status message to the client(something like value of iteration) for each iteration. I tried this using callbacks but failed.
Can any one suggest solution for this scenario.
Thanks in advance.
Pavan.
推荐答案
AFAIK,你做不到:你会有实现要求服务器执行方法X的通信的一部分 - 您不能在客户端内的服务器上执行方法,因为它们是具有自己的存储空间的单独进程等等,甚至可能不是在同一台机器上!
AFAIK, you can't do that: you would have to implement a part of your communications which asked the server to "execute method X" - you can't execute a method on the server within the client, because they are separate processes with there own memory spaces and so forth, and may not even be on the same machine!
这篇关于C#窗体中的回调的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文