在VS Express中创建Windows服务 [英] Creating a Windows Service in VS Express

查看:100
本文介绍了在VS Express中创建Windows服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好



我正在寻找解决我的小问题的方法。我有各种Windows应用程序,所有应用程序。我希望有一个常见的Windows服务来为所有这些应用程序提供一些基本的支持。

我是Windows服务的新手,但我认为Windows Web服务是解决我的问题的方法。

以下是我需要从服务中完成的细节:



1.从网上发送和获取数据(如RSS等)

2.读写数据库。



服务必须具有输入和输出参数才能与应用程序交互。例如,在将数据从不同的应用程序传递到公共服务的参数中,输出参数以向调用表单或特定事件发出一些通知,它必须能够通知表单显示表单(这意味着我的窗体表单必须有一个公共函数来接收通知)。



我需要在Visual Studio Express Edition中使用VB.NET或者用VB.NET进行夏普开发,请帮助我使用任何示例或指导来开始使用Windows服务。

Hello

I am looking for a solution to my little problem. I have various windows applications, all applications. I want to have a common windows service to provide some basic support to all these applications.
I am new to Windows Services, but I think a windows web service is solution to my problem.
Below is the detail I need to accomplish from a service:

1. Sending and fetching data from Web (like RSS etc)
2. Reading and writing database.

A service must have in and out parameters to interact with applications. Example, In parameters to pass the data from different application to a common service, out parameter to give some notification to calling form or on a particular event, it must be able to notify the form to show a form (It means my windows form must have a public function to receive notification).

I need to use VB.NET with Visual Studio Express Edition or may be Sharp develop with VB.NET, Kindly help me with any example or guidance to start working on the Windows Services.

推荐答案

这不是一个快速回答的问题。看来,你自己没有尝试过任何东西。现在这是它如何工作,我们不会做你的工作。但这里有一些指导:

1)VS Express没有Windows服务时间。 SharpDevelop有。但VS比SD更方便使用。只需在SD中添加空服务,而不是在VS Express中打开,您就拥有了所需的一切,因为其余的就在那里,只是缺少模板。

2)这是一个基本的walktrough关于您可以作为开始使用的Windows服务: http://msdn.microsoft .com / zh-CN / library / zt39148a%28v = vs.110%29.aspx [ ^ ]

3)Bor所有的http流量,你可以使用 HttpClient [ ^ ]

4)有许多方法可以阅读RSS源,但你可以从这个开始: http://madskristensen.net/post / simple-rss-reader-class-in-c [ ^ ]

5)数据库部分是一个强制性问题。它取决于。假设您希望SQL Server作为支持。在这种情况下,我建议您使用实体框架,而不是从这里开始: http://www.entityframeworktutorial.net/ [ ^ ]



但这些只是您需要注意的部分内容。所以我建议你开始阅读和练习,测试和调试......
This is not a "quick answers" kind of question. It seems, that you haven't tried anything on your own. This is now how it works here, we won't do your job. But here is some guidance:
1) VS Express has no Windows Service tempalte. SharpDevelop has. But VS is more convenient to use than SD. Simply add the empty Service in SD than open in in VS Express, and you have all that you need, since the rest is there, just the template is missing.
2) Here is a basic walktrough about Windows Services you can follow as a start: http://msdn.microsoft.com/en-us/library/zt39148a%28v=vs.110%29.aspx[^]
3) Bor all http traffic, you can use HttpClient[^]
4) There are many approaches to read RSS feeds, but you can start with this one: http://madskristensen.net/post/simple-rss-reader-class-in-c[^]
5) The database part is a compelx question. It depentd. Let's suppose you want SQL server as backed. In this case I suggest you use Entity Framework, than start here: http://www.entityframeworktutorial.net/[^]

But these are only some portions of what you will need to take care about. So I suggest you start reading and practicing and testing and debugging...


这篇关于在VS Express中创建Windows服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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