C#windows服务exe [英] C# windows service exe

查看:79
本文介绍了C#windows服务exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请在下面的方案中建议。



我有一个逻辑,它将进行联合操作并向关注人发送邮件。此外,我们正在处理许多客户,所以我不能让单个exe为所有客户执行。因此我应该为每个客户提供单独的exe,但内部逻辑对所有人来说都是相同的。



我打算做C#windows服务。这是一个权利方法或任何其他方式,我可以为所有客户建立一个单独的构建。



我尝试过:



目前我们正在为每个客户端使用C#windows service exe,我需要在任务sheduler中单独进行管理。当我们迁移任何补丁时,它非常困难

please suggest below scenario.

I have a logic which will do co-relation operation and send a mail to the concern person. Also we are dealing with many clients so i can't have single exe to perform for all customer. Hence i should have separate exe for each customer but inside logic is going to be same for all.

I am planning to do as C# windows service.Is this a right approach or any other way where i can have a single build for all clients.

What I have tried:

currently we are using C# windows service exe for each client i need to separately shedule in task sheduler.Its very difficlut when we are migrating any patch

推荐答案

假设程序都做了完全相同的事情,但需要知道他们正在执行哪些客户的操作,那么你可以用一个略有不同的名称多次安装服务并传递一个参数让它知道哪个客户。



参见 c# - 如何使用参数创建Windows服务? - Stack Overflow [ ^ ]提供一些建议。



我做过类似的事情,但服务连续运行(未安排)并使用了filewatchers
Assuming the programs are all doing exactly the same thing but need to know which customer they are performing the actions for then you can just installed the service multiple times with a subtly different name and pass it a parameter so it knows which customer.

See c# - How to make a Windows service with parameters? - Stack Overflow[^] for some suggestions.

I've done something similar but the services were running continuously (not scheduled) and utilised filewatchers


这篇关于C#windows服务exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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