static void Main(string[] args) { _ins = new List <Instance>(); _insfiles = new InstanceFiles(AppDomain.CurrentDomain.BaseDirectory + @"\ins.json"); _insfiles.LoadFromFiles(); _ins = _insfiles.GetInstances(); foreach (Instance t in _ins) { t.Start(); } Console.ReadKey(); }
//服务启动 protected override void OnStart(string[] args) { _insfiles = new InstanceFiles(); _insfiles.LoadFromFiles(); _ins = _insfiles.GetInstances(); foreach (var i in _ins) { i.Start(); } Log.OutLine("服务启动成功!"); base.OnStart(args); }