Uri uri = new Uri("http://172.16.238.156:8000/");
            ServiceHost host = new ServiceHost(typeof(WcfServer.ChatDuplex), uri);
            WSDualHttpBinding ws = new WSDualHttpBinding();
            ws.Security.Mode = WSDualHttpSecurityMode.None;
            host.AddServiceEndpoint(typeof(IChatDuplex), ws, "Svc");
            host.Open();
            MessageBox.Show("服务启动");

posted on 2015-03-05 17:10  linbl  阅读(407)  评论(0编辑  收藏  举报