如何在C#.net中调用窗口服务方法 [英] how to call window service methods in C#.net

查看:71
本文介绍了如何在C#.net中调用窗口服务方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的要求
1.在一台计算机上运行窗口服务
2.如果我单击按钮,另一台计算机c#应用程序正在c#应用程序中运行
3.我要致电窗口服务.

请帮助我

my requirment
1.In one computer window service is running
2.Another computer c#application is running in c# application if i click a button
3.i want to call window service.

plz help me

推荐答案

您不会调用" Windows服务.您可以发送命令(如果您有足够的特权),甚至可以将其设置为WCF服务器.

安全性将是一个问题,尤其是如果所涉及的计算机与您不在同一局域网中时.建议您以研究的形式进行尽职调查. Google是您的朋友.
You don''t "call" a windows service. You can send it commands (if you have sufficient privileges), and you can probably even set it up to be a WCF server.

Security would be an issue, especially if the computer in question wasn''t on the same LAN as you. Performing due diligence in the form of research on your part is suggested. Google is your friend.


您需要该服务来提供一些与客户进行交流的方式.这可以通过TCP服务器,远程服务甚至WCF服务来实现.


------

根据您的进一步答复(由于需要进一步评论,我将其删除),这是一篇有关使用WCF的很好的介绍性文章:
WCF简介-第1部分 [
You''d need the service to provide some means for client-communication. This could be via a TCP server, a remoting service, or even a WCF service.


------

Based on your further responses (which I removed since they need to be comments), here''s a good intro article to using WCF:

WCF Introduction - Part1[^]


只是一个重要的概念性注释:调用"的概念仅是有效的用于相同线程的代码(不只是相同的应用程序域或相同的进程).调用机制基本上是基于堆栈的,但是不同的线程使用不同的堆栈.

具有调用语义的其他所有内容都可以是线程间调用(具有相同的应用程序域)或RPC(远程过程调用,
http://en .wikipedia.org/wiki/Remote_procedure_call [ ^ ] ).

同样,重要的是要理解:即使对于同一台计算机上的不同进程,甚至对于同一进程的不同应用程序域,它也必须是RPC.

使用.NET,RPC语义是通过经典的远程处理或WCF实现的.

—SA
Just an important conceptual note: a notion of "call" is only valid for the code of the same thread (not just the same Application Domain or the same process). The call mechanism is fundamentally based on stack, but different thread use different stacks.

Everything else with call semantic could be inter-thread invocation (withing the same Application Domain) or RPC (Remote Procedure Call, http://en.wikipedia.org/wiki/Remote_procedure_call[^]).

Again, important to understand: even for different processes on the same machine, even for different Application Domain of the same Process it has to be RPC.

With .NET, RPC semantics is implemented with classic remoting or WCF.

—SA


这篇关于如何在C#.net中调用窗口服务方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆