wcf 的实例化调用的知识点

 ServiceHost client = new ServiceHost(typeof(WebApplication1.Service1));
            client.Open();
            using (ChannelFactory<IService1> factory = new ChannelFactory<IService1>("Service1"))
            {
                IService1 client1=factory.CreateChannel();
                Label1.Text = client1.DoWork();
            }
            client.Close();

posted @ 2012-06-04 15:38  (二少)在南极  阅读(188)  评论(0编辑  收藏  举报