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

📄 sipcwwwauthenticateheader.cs

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

    public class SipcWWWAuthenticateHeader : SipcHeader
    {
        private string _algorithm;
        private string _method;
        private string _nonce;

        public SipcWWWAuthenticateHeader() : base("W")
        {
            this._method = string.Empty;
            this._algorithm = string.Empty;
            this._nonce = string.Empty;
        }

        public SipcWWWAuthenticateHeader(string value) : base("W", value)
        {
            this._method = string.Empty;
            this._algorithm = string.Empty;
            this._nonce = string.Empty;
        }

        public override void Parse(string value)
        {
            base.Value = value;
            int length = value.IndexOf(" ");
            if (length >= 0)
            {
                this._method = value.Substring(0, length).Trim();
                foreach (string text in value.Substring(length + 1).Split(new char[] { ',' }))
                {
                    string[] textArray2 = text.Trim().Split(new char[] { '=' });
                    if (textArray2.Length > 1)
                    {
                        if (textArray2[0].ToLower() == "algorithm")
                        {
                            this._algorithm = textArray2[1].Trim().Trim(new char[] { '"' });
                        }
                        else if (textArray2[0].ToLower() == "nonce")
                        {
                            this._nonce = textArray2[1].Trim().Trim(new char[] { '"' });
                        }
                    }
                }
            }
        }

        public override string ToString()
        {
            return string.Format("{0}: {1} algorithm=\"{2}\",nonce=\"{3}\"", new object[] { "W", this._method, this._algorithm, this._nonce });
        }

        public string Algorithm
        {
            get
            {
                return this._algorithm;
            }
            set
            {
                this._algorithm = (value == null) ? string.Empty : value.Trim();
            }
        }

        public string Method
        {
            get
            {
                return this._method;
            }
            set
            {
                this._method = (value == null) ? string.Empty : value.Trim();
            }
        }

        public string Nonce
        {
            get
            {
                return this._nonce;
            }
            set
            {
                this._nonce = (value == null) ? string.Empty : value;
            }
        }
    }
}

⌨️ 快捷键说明

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