111,126
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.ServiceProcess;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using System.IO;
namespace NewTest
{
public partial class Service1 : ServiceBase
{
public Service1()
{
InitializeComponent();
thd = new Thread(new ThreadStart(Run));
}
Thread thd;
protected override void OnStart(string[] args)
{
thd.Start();
}
void Run()
{
while (true)
{
MessageBox.Show("我这里需要显示输出。");
Thread.Sleep(10*1000);
}
}
}
}