public static bool GetFlag(this NameValueCollection collection, [Localizable(false)] string key) {
return collection.Keys.OfType<string>().Contains(key) &&
Regex.IsMatch(collection.Get(key) ?? @"on", @"^(1|yes|ok|on|true)$", RegexOptions.IgnoreCase);
}
}