You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.1 KiB
44 lines
1.1 KiB
4 years ago
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.ComponentModel;
|
||
|
using System.Data;
|
||
|
using System.Diagnostics;
|
||
|
using System.Linq;
|
||
|
using System.ServiceProcess;
|
||
|
using System.Text;
|
||
|
|
||
|
namespace MsgSendService
|
||
|
{
|
||
|
partial class SendService : ServiceBase
|
||
|
{
|
||
|
public SendService()
|
||
|
{
|
||
|
InitializeComponent();
|
||
|
}
|
||
|
|
||
|
protected override void OnStart(string[] args)
|
||
|
{
|
||
|
// TODO: 在此处添加代码以启动服务。
|
||
|
QMFrameWork.Data.DataFactory.Configure(true);
|
||
|
QMFrameWork.Log.LogManager.Configure("log4net");
|
||
|
|
||
|
SendClass sendClass = new SendClass();
|
||
|
DelegateName dn = new DelegateName(sendClass.SendMsg);
|
||
|
AsyncCallback acb = new AsyncCallback(CallBackMethod);
|
||
|
dn.BeginInvoke(acb, dn);
|
||
|
}
|
||
|
|
||
|
private delegate void DelegateName();
|
||
|
|
||
|
protected override void OnStop()
|
||
|
{
|
||
|
// TODO: 在此处添加代码以执行停止服务所需的关闭操作。
|
||
|
}
|
||
|
|
||
|
private void CallBackMethod(IAsyncResult ar)
|
||
|
{
|
||
|
|
||
|
}
|
||
|
}
|
||
|
}
|