WCF摘记

           //绑定形式
            NetTcpBinding bind = new NetTcpBinding();
            //地址
            EndpointAddress address = new EndpointAddress("net.tcp://localhost:3200/hello");
            //通道工厂
            ChannelFactory<ClassLibrary1.myInterface> factory = new ChannelFactory<ClassLibrary1.myInterface>(bind,address);

            ClassLibrary1.myInterface myobject = factory.CreateChannel();
            string time = myobject.getServerTime();
            MessageBox.Show(time);

  

posted @ 2014-02-15 16:15  awp110  阅读(164)  评论(0编辑  收藏  举报