replypasswordmethodsocks5message.cs
来自「破解的飞信源代码」· CS 代码 · 共 65 行
CS
65 行
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 + =
减小字号Ctrl + -
显示快捷键?