sandaman2019

System.Type类
System.Type类对于反射有很重要的作用。它是一个抽象的基类,Type有与每种数据类型对应的派生类,我们使用这个派生类的对象的方法、字段、属性来查找有关该类型的所有信息。
获取给定类型的Type值有三种常用方式:

使用C# typeof运算符
Type t=typeof(string);
使用对象的GetType()方法
string s=”guo”;Type t=s.GetType();
调用Type类的静态方法GetType()
Type t=Type.GetType(“System.String”);
---------------------
作者:changuncle
来源:CSDN
原文:https://blog.csdn.net/xiaouncle/article/details/52983924

分类:

技术点:

相关文章:

  • 2021-06-27
  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
  • 2022-02-16
猜你喜欢
  • 2021-11-22
  • 2021-04-02
  • 2021-07-20
  • 2022-12-23
  • 2022-12-23
  • 2022-01-12
相关资源
相似解决方案