Asp.net,C#应用程序和Windows服务 [英] Asp.net, C# application and windows service

查看:86
本文介绍了Asp.net,C#应用程序和Windows服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想构建一个描述如下的系统:

该系统分为三部分. Web应用程序和C#应用程序将使用Window Service程序中的服务.

但是我不知道如何从Web应用程序连接到Window Service.如果使用套接字,则每次用户使用Web应用程序时都必须连接.我只想在运行系统时进行一次连接.该怎么做?

很抱歉我的英语不好

Hi everybody,

I would like to build a system as describe bellow:

There are 3 part in this system. Web Application and C# Application will use service from Window Service program.

But i don''t know how to connect from Web Application to Window Service. If use socket, it will have to connect every time user use web application. I would like to connect just one time when I run my system. How to do this?

I''m sorry for my bad English

推荐答案

您可能会发现
You might find this article from MSDN Magazine[^] useful for the Windows Service to Web App part of your system.


在Windows Service中使用自托管的WCF服务,可以连接客户端Web和C#应用程序可以:

http://msdn.microsoft.com/en-us/library/ms731758.aspx [ ^ ]
Use a self-hosted WCF Service inside your Windows Service that you can connect your client Web and C# applications to:

http://msdn.microsoft.com/en-us/library/ms731758.aspx[^]


如果当前未使用连接,则不应将它们保持打开状态.它为黑客提供了一种攻击媒介.

如已经建议的那样,将WCCF服务放在WIndows服务中,该服务允许您的Web应用程序和您的桌面应用程序根据需要连接到它.
You shouldn''t leave connections open if they''re not currently being used. It provides an attack vector for hackers.

As already suggested, put a WCCF service in the WIndows service that allows your web app and your Desktop app connect to it as needed.


这篇关于Asp.net,C#应用程序和Windows服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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