获取程序集的类型信息
作者:互联网
using (var stream = new FileStream(@"E:\mscorlib.dll", FileMode.Open)) { var reader = new PEReader(stream); var metaDataReader = reader.GetMetadataReader(MetadataReaderOptions.Default); foreach (var def in metaDataReader.TypeDefinitions) { var name = metaDataReader.GetString(metaDataReader.GetTypeDefinition(def).Name); Console.WriteLine(name); } }
标签:类型信息,stream,程序,metaDataReader,获取,reader,var,new,name 来源: https://www.cnblogs.com/chenyingzuo/p/15272193.html