System.Net.WebHeaderCollection.GetKey C# (CSharp) Метод

GetKey() публичный Метод

public GetKey ( int index ) : string
index int
Результат string
        public override string GetKey(int index) { throw null; }
        public override void Clear() { }

Usage Example

 private static Dictionary<string, string> GetHeadersDictionaryFrom(WebHeaderCollection headers)
 {
     string pattern = "\\s+";
     Dictionary<string, string> dictionary = new Dictionary<string, string>();
     for (int i = 0; i < headers.Keys.Count; i++)
     {
         string key = headers.GetKey(i).Replace("-", " ").ToUpper();
         key = Regex.Replace(key, pattern, "");
         string value = headers.Get(headers.GetKey(i));
         //System.Console.WriteLine("Key => " + key + " Value => " + value);
         dictionary.Add(key, value);
     }
     return dictionary;
 }
All Usage Examples Of System.Net.WebHeaderCollection::GetKey