ex-18-03

来自「Programming Csharp Source Code(代码) Prog」· 代码 · 共 24 行

TXT
24
字号
// Example 18-03: Reflecting on an assembly

namespace Programming_CSharp
{
    using System;
    using System.Reflection;

    public class Tester
    {
        public static void Main()
        {
            // what is in the assembly
            Assembly a = Assembly.Load("Mscorlib.dll");
            Type[] types = a.GetTypes();
            foreach(Type t in types)
            {
                    Console.WriteLine("Type is {0}", t);
            } 
            Console.WriteLine(
               "{0} types found", types.Length);
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?