• TcpServerChannel 类服务


    服务端

                var provider = new BinaryServerFormatterSinkProvider();
                provider.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;

                IDictionary props = new Hashtable();
                props["name"] = "ServerPacs";
                props["port"] = port.toInt();
                props["typeFilterLevel"] = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;

                props["secure"] = true; 打开认证;
                props["impersonate"] = true;
                props["protectionLevel"] = System.Net.Security.ProtectionLevel.Sign;

               var tcpserver = new TcpServerChannel(props, provider, Auth);

                ChannelServices.RegisterChannel(tcpserver, true);/打开认证;

           

    客户端:

                    var bcprovider = new BinaryClientFormatterSinkProvider();
                    IDictionary props = new Hashtable();

                    props["name"] = "ServerPacs";
                    props["secure"] = true;
                    props["impersonate"] = true;
                    props["protectionLevel"] = System.Net.Security.ProtectionLevel.Sign;
                    props["tokenImpersonationLevel"] = System.Security.Principal.TokenImpersonationLevel.Impersonation;
                    //props["authorizationModule"] = "PacsClassServer.AuthorizationModule,hello";
                    //props["useDefaultCredentials"] = "false";
                    //props["domain"] = "172_21_0_15";
                    props["username"] = "admin";
                    props["password"] = "xxxx;   
                    var client = new TcpClientChannel(props, bcprovider);
                    ChannelServices.RegisterChannel(client, true);

    在服务器操作系统上建立一个新账号,在客户端配置,即可完整认证。

  • 相关阅读:
    Jenkins 权限管理
    Git分布式版本控制系统——git学习准备工作
    闭包详解,柯里化的含义及操作方法
    vue3+vuex4
    React 钩子汇总
    网络安全-终端防护设备
    python opencv手动实现cv2.GaussianBlur
    A133P EC200M模块调试
    vue 在线预览word
    SpringBoot+Vue项目自习室座位预约系统
  • 原文地址:https://blog.csdn.net/joman5/article/details/132739823