把托盘图标和主界面窗体分离
using System; using System.Collections.Generic; using System.Text; namespace XAgent { class Program { static void Main(string[] args) { AgentService.ServiceMain(); } } }