获取程序集的类型信息

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);
    }
}

 

上一篇:js上传多张图片并显示


下一篇:ajax 下载