分类:
.net
代码如下:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.ServiceModel; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { using (ServiceHost serviceHost = new ServiceHost(typeof(Service1))) { //监听事件 serviceHost.Opening += serviceHost_Opening; serviceHost.Opened += serviceHost_Opened; //开启接口 serviceHost.Open(); Console.ReadLine(); } } static void serviceHost_Opened(object sender, EventArgs e) { Console.WriteLine("接口发布成功"); } static void serviceHost_Opening(object sender, EventArgs e) { Console.WriteLine("接口发布中..."); } } }
欢迎加群讨论技术,1群:677373950(满了,可以加,但通过不了),2群:656732739
评价
排名
6
文章
6
粉丝
16
评论
8
{{item.articleTitle}}
{{item.blogName}} : {{item.content}}
ICP备案 :渝ICP备18016597号-1
网站信息:2018-2024TNBLOG.NET
技术交流:群号656732739
联系我们:contact@tnblog.net
公网安备:50010702506256
欢迎加群交流技术