当前位置 : 主页 > 编程语言 > c语言 >

C# 自定义类中括号取值 测试

来源:互联网 收集:自由互联 发布时间:2021-06-25
public class ABC : Hashtable{} static class Program { public static ABC a= new ABC(); static void Main( string [] args) { var c = a[ " 0 " ]; // 自定义类中括号取值 } } var t = Request.Form[ " sets " ].ToString(); public abstract cl
    public class ABC : Hashtable{}
    static class Program
    {
        public static ABC  a= new ABC();
        static void Main(string[] args)
        {
            var c = a["0"]; //自定义类中括号取值
        }
    }

 

        var t = Request.Form["sets"].ToString();
  public abstract class HttpRequest
    {
        public abstract IFormCollection Form { get; set; }
    }

    public interface IFormCollection : IEnumerable<KeyValuePair<string, StringValues>>, IEnumerable
    {
  

        StringValues this[string key] { get; }

        int Count { get; }
     
        ICollection<string> Keys { get; }

        IFormFileCollection Files { get; }


        bool ContainsKey(string key);

      
        bool TryGetValue(string key, out StringValues value);
}
网友评论