你指的是不是task schedule啊,建议把它写成window service组件吧,这样稳定性好一些,然后你通过windowcontroller来管理这个组件,至于用不用托盘,也不是很重要,重要的是你要让程序一直在后台运行。

解决方案 »

  1.   

    using System.ServiceProcess;namespace WindowsService1
    {
    public class Service1 : System.ServiceProcess.ServiceBase
    {

    private System.ComponentModel.Container components = null; public Service1()
    {

    InitializeComponent(); } // 进程的主入口点
    static void Main()
    {
    System.ServiceProcess.ServiceBase[] ServicesToRun;

    // 同一进程中可以运行多个用户服务。若要将
    //另一个服务添加到此进程,请更改下行
    // 以创建另一个服务对象。例如,
    //
    //   ServicesToRun = New System.ServiceProcess.ServiceBase[] {new Service1(), new MySecondUserService()};
    //
    ServicesToRun = new System.ServiceProcess.ServiceBase[] { new Service1() }; System.ServiceProcess.ServiceBase.Run(ServicesToRun);
    }