分类:
WCf
static void Main(string[] args) { using(ServiceHost ser=new ServiceHost (typeof(Service1))){ ser.Opening += ser_Opening; ser.Opened += ser_Opened; //开启接口 ser.Open(); //用来防止using讲进程结束 Console.ReadLine(); } } static void ser_Opened(object sender, EventArgs e) { Console.WriteLine("接口发布完成!"); } static void ser_Opening(object sender, EventArgs e) { Console.WriteLine("接口发布中"); } }
评价