您的位置:首页 > 其它

怎样判断一个泛型的数据具体是什么类型

2008-12-23 14:41 573 查看
static void Main(string[] args)
        {
            AAAA<string>(new List<string>());
        }
        public static void AAAA<TSource>(IList<TSource> AList)
        {
            Type t = Type.GetType(Regex.Match(AList.GetType().FullName.Replace("[[", "[").Replace("]]", "]"), @"/[(?<type>[^/]]+)/]").Groups["type"].Value);
            Console.WriteLine(t.FullName);
        }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: