[英]How to get all the system types or built in types used in a C# class
I am trying to list all the system types used in a C# class. 我试图列出在C#类中使用的所有系统类型。 For example,
例如,
class Program
{
static void Main(string[] args)
{
int i = 0;
Console.WriteLine(i.ToString());
}
private void SomeMethod(float parm1, double param2)
{
Assembly assembly = Assembly.LoadFrom(@"AssemblyName");
}
}
Here I want to list, 在这里我要列出,
- Int32
32位
- Console
安慰
- Void
空洞
- Assembly
部件
- float
浮动
- double
双
- string
串
How to do this? 这个怎么做?
typeof(int).Assembly.GetTypes().Where(t => t.IsPrimitive);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.