/// <summary> /// 初始化任务 /// </summary> /// <param name="appId">任务id</param> /// <param name="commandPipeHandle">命令匿名管道话柄</param> /// <param name="configs">配置文件</param> /// <returns>任务对象</returns> public static TaskApp Init(int appId, string commandPipeHandle, string configs) { //初始化配置文件 if (!string.IsNullOrEmpty(configs)) { InitConfig(configs); } //创建任务app var taskApp = new TaskApp(appId, commandPipeHandle); return(taskApp); }
static void Main(string[] args) { int appId = Convert.ToInt32(args[0]); string commandPipeHandle = args[1]; string configs = null; if (args.Length >= 3) { configs = args[2]; } TaskApp.Init(appId, commandPipeHandle, configs).Run(); Environment.Exit(0); }