C#Windows服务 [英] C# Windows Service

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

问题描述

我创建了一个Windows服务,它将从数据库中获取数据,并将其存储在系统中的某个位置,该位置进一步发送一封电子邮件作为附件。





我给定时间间隔30秒。



每次重复此过程30秒。但是它没有发生。



此外当我尝试手动删除路径中的文件时,它提到该文件在EWSService中打开(提供的服务名称) )。



如何解决这个问题。

I have created an windows service which will fetch the data from database and it is stored in a location in system which further sends an email with this as an attachment.


I have given the timer interval for 30 sec.

So automatically every time this process should be repeated for 30 sec. but it is not happening.

Also When i try to manually delete the file in the path it is mentioning that the file is open in EWSService(name of the service provided).

How to solve this.

推荐答案

Hello Harsha,



对于您想要实现的目标,无需创建服务。只需使用任务计划。但是,如果你想沿着服务路径前进,那么我可以从这个站点本身提出一些例子。



  • 任务调度程序[^ ]
  • .NET Windows服务计划程序[^ ]
Hello Harsha,

For what you want to achieve no need to create a service. Simply use the Task Schedular. However if you want to go down the service path then I can suggest few example from this site itself.

  • Task Scheduler[^]
  • .NET Windows Service Scheduler [^]


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

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