示例#1
0
        private static CMSClient ConnectToCMS()
        {
            try
            {
                NetTcpBinding binding = new NetTcpBinding();
                InitializeWindowsAuthentication(binding);
                EndpointAddress address          = new EndpointAddress(new Uri(ConfigurationSettings.AppSettings.Get("CMSProxy")));
                var             callbackInstance = new ClientCallback();
                CMSClient       proxy            = new CMSClient(callbackInstance, binding, address);
                proxy.RegisterClient();

                return(proxy);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return(null);
            }
        }