⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 replypasswordmethodsocks5message.cs

📁 破解的飞信源代码
💻 CS
字号:
namespace Imps.Client.CommLayer.SocksSipConnection
{
    using System;

    internal sealed class ReplyPasswordMethodSocks5Message : Socks5Message
    {
        private byte _status;

        private ReplyPasswordMethodSocks5Message(byte status)
        {
            this.Status = status;
        }

        public static ReplyPasswordMethodSocks5Message Parse(byte[] buffer)
        {
            ReplyPasswordMethodSocks5Message message;
            try
            {
                if (((buffer == null) || (buffer.Length != 2)) || (buffer[0] != 1))
                {
                    throw new ArgumentException("ReplyPasswordMethodSocks5Message.Parse()的参数buffer无效!");
                }
                byte status = buffer[1];
                message = new ReplyPasswordMethodSocks5Message(status);
            }
            catch (Exception exception)
            {
                throw new SocksConnectionException("代理服务器对用户名/密码方式验证的应答无效", exception, SocksConnectionErrorCode.ReplyError);
            }
            return message;
        }

        public override byte[] ToBinary()
        {
            return new byte[] { 1, this.Status };
        }

        public override string ToString()
        {
            return string.Concat(new object[] { "VER : ", base.Ver, "\n", "STATUS : ", this.Status });
        }

        public bool IsSuccessed
        {
            get
            {
                return (this.Status == 0);
            }
        }

        public byte Status
        {
            get
            {
                return this._status;
            }
            private set
            {
                this._status = value;
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -