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

📄 keyfield.cs

📁 pureIRCd是一个用c语音写的irc(RFC459)服务,可以给您带来很多的方便
💻 CS
字号:
using SDP;
using System;

/// <summary>
/// A Key represents the k= field contained within either a MediaDescription or a SessionDescription.
/// </summary>
public class KeyField : Field
{
    private string method;
    /// <summary>
    /// Gets the method of encryption to use. See <see cref="EncryptionMethods"/>
    /// </summary>
    public string Method
    {
        get { return this.method; }
    }

    /// <summary>
    /// Determines whether or not a key is present.
    /// </summary>
    public bool HasKey
    {
        get { return !String.IsNullOrEmpty(this.method); }
    }

    private string key;
    /// <summary>
    /// Gets the encryption key, if there is one.
    /// </summary>
    public string Key
    {
        get { return this.key; }
    }
    
    /// <summary>
    /// Creates a new KeyField.
    /// </summary>
    /// <param name="value">The value portion of the field.</param>
    public KeyField(string value)
        : base("k=" + value)
    {
        string val = base.Value;
        string[] parts = val.Split(':');
        this.method = parts[0];
        if (parts.Length > 1) this.key = parts[1];
    }

    /// <summary>
    /// Creates a new KeyField.
    /// </summary>
    /// <param name="method">The encryption method.</param>
    /// <param name="key">The key.</param>
    public KeyField(string method, string key) : this(method + (String.IsNullOrEmpty(key) ? "" : ":" + key)) { }
}

⌨️ 快捷键说明

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