.NET自动服务程序—C#(二)
追风(VisualSW)
启动服务:
定义两个变量:
private string[,] arrConf;保存配置信息
private Assembly[] assObj;加载组件
在OnStart事件中添加如下代码:
protected override void OnStart(string[] args)
{
WriteLog("/************************************************************/");
WriteLog("ScheculerServer Start at "+DateTime.Now.ToString());
//Load Configuation
if(!ReadConf())return;
//Load Assembly
try
{
assObj=new Assembly[arrConf.GetLength(1)];
for(int i=0;i<assObj.Length;i++)
{ </