[英]How to get all the system types or built in types used in a C# class
我試圖列出在C#類中使用的所有系統類型。 例如,
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");
}
}
在這里我要列出,
- 32位
- 安慰
- 空洞
- 部件
- 浮動
- 雙
- 串
這個怎么做?
typeof(int).Assembly.GetTypes().Where(t => t.IsPrimitive);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.