Пример #1
0
        public string sKey; //用户MD5加密的密钥。

        public ModelMember CopyTo()
        {
            ModelMember newobj = new ModelMember();

            newobj.uID                 = this.uID;
            newobj.netname             = this.netname;
            newobj.netpass             = this.netpass;
            newobj.cookies             = this.cookies;
            newobj.formhash            = this.formhash;
            newobj.sitenum             = this.sitenum;
            newobj.hdinfo              = this.hdinfo;
            newobj.realname            = this.realname;
            newobj.expire              = this.expire;
            newobj.other               = this.other;
            newobj.email               = this.email;
            newobj.userMoney           = this.userMoney;
            newobj.group               = this.group;
            newobj.IS_X_WordPressBuild = this.IS_X_WordPressBuild;
            newobj.IS_X_PostKing       = this.IS_X_PostKing;

            newobj.logintime     = this.logintime;
            newobj.ipaddress     = this.ipaddress;
            newobj.bLoginSuccess = this.bLoginSuccess;
            newobj.strMessage    = this.strMessage;

            return(newobj);
        }
Пример #2
0
        private void StartSycReceive()
        {
            byte[] result = new byte[1024];//这个缓冲区,够大吗?

            if ((clientSocket = SocketHelper.GetSocket()) == null)
            {
                return;
            }

            //通过clientSocket接收数据
            int receiveLength = clientSocket.Receive(result);

            EchoHelper.Echo("接收服务端消息成功:" + Encoding.ASCII.GetString(result, 0, receiveLength), "系统登录", EchoHelper.EchoType.任务信息);
            //通过 clientSocket 发送数据
            try {
                member.strCommand = "login";
                byte[] bufs = db.ClasstoByte(member, "VCDS");
                SocketHelper.SendVarData(clientSocket, bufs);

                while (true)
                {
                    byte[]      rets     = SocketHelper.ReceiveVarData(clientSocket);
                    ModelMember remember = (ModelMember)db.BytetoClass(rets, "VCDS");

                    switch (remember.strCommand)
                    {
                    case "login":
                        if (remember.bLoginSuccess)
                        {
                            //MessageBox.Show("登录成功, 过期时间:" + ret.expire);//+ " 登录名:" + ret.netname + " 密码:" + ret.netpass);
                        }
                        else
                        {
                            MessageBox.Show(remember.strMessage);
                        }
                        break;

                    case "exit":
                        clientSocket.Shutdown(SocketShutdown.Both);
                        clientSocket.Close();
                        EchoHelper.Echo(remember.strMessage, "系统登录", EchoHelper.EchoType.错误信息);
                        Thread.Sleep(5000);
                        Environment.Exit(0);
                        break;

                    case "quit":
                        clientSocket.Shutdown(SocketShutdown.Both);
                        clientSocket.Close();
                        Environment.Exit(0);
                        return;
                    }
                }
            } catch (Exception ex) {
                //EchoHelper.EchoException(ex);
            } finally {
                clientSocket.Shutdown(SocketShutdown.Both);
                clientSocket.Close();
            }
        }
Пример #3
0
        private bool ValidateUser(ref ModelMember member)
        {
            member.IS_X_PostKing = false;

            //验证是否具有发帖权限
            string testpostUrl = "http://www.renzhe.org/forum.php?mod=post&action=newthread&fid=36";

            string html = new xkHttp().httpGET(testpostUrl, ref member.cookies);

            if (html.Contains("发表帖子 - 忍者X2站群 -  忍者软件 -  RenZhe.org!"))
            {
                EchoHelper.Echo("恭喜您,权限核对成功,您已被授权使用忍者X2站群!", "用户验证", EchoHelper.EchoType.任务信息);
                member.strMessage    = "恭喜您,权限核对成功,您已被授权使用忍者X2站群!";
                member.IS_X_PostKing = true;
            }
            else if (html.Contains("抱歉,您需要设置自己的头像后才能进行本操作"))
            {
                EchoHelper.Echo("请完善您的(基本资料、头像),即在论坛上发个帖子激活一下。授权论坛:www.renzhe.org!", "用户验证", EchoHelper.EchoType.错误信息);
                member.strMessage = "请完善您的(基本资料、头像),即在论坛上发个帖子激活一下。授权论坛:www.renzhe.org!";
            }
            else if (html.Contains("请先绑定手机号码"))
            {
                EchoHelper.Echo("请先绑定手机号码,授权论坛:www.renzhe.org!", "用户验证", EchoHelper.EchoType.错误信息);
                member.strMessage = "请先绑定手机号码,授权论坛:www.renzhe.org!";
            }
            else if (html.Contains("<s>商业授权用户</s>"))
            {
                EchoHelper.Echo("您的账户已过期,请到论坛充值续费!", "用户验证", EchoHelper.EchoType.错误信息);
                member.strMessage = "您的账户已过期,请到论坛充值续费!";
            }
            else if (html.Contains("超时"))
            {
                EchoHelper.Echo("链接服务超时!", "用户验证", EchoHelper.EchoType.错误信息);
                member.strMessage = "链接服务超时!";
            }
            else if (html.Contains("没有权限在该版块发帖"))
            {
                EchoHelper.Echo("用户登录验证失败,请重新登录!", "用户验证", EchoHelper.EchoType.错误信息);
                member.strMessage = "用户登录验证失败,请重新登录!";
            }
            else if (html.Contains("无法解析此远程名称"))
            {
                EchoHelper.Echo("域名解析出现问题,请检查您的网络设置!", "用户验证", EchoHelper.EchoType.错误信息);
                member.strMessage = "域名解析出现问题,请检查您的网络设置!";
            }
            else
            {
                EchoHelper.Echo("验证失败,原因未知!", "用户验证", EchoHelper.EchoType.错误信息);
                member.strMessage = "验证失败,原因未知!";
            }

            if (member.group.Contains("商业授权用户"))
            {
                member.IS_X_WordPressBuild = true;
            }
            else
            {
                member.IS_X_WordPressBuild = false;
            }
            return(member.IS_X_PostKing);
        }