gpt4 book ai didi

c# - 将内部类更改为公共(public)类(CIL、Mono.Cecil)

转载 作者:太空宇宙 更新时间:2023-11-03 15:38:36 25 4
gpt4 key购买 nike

有没有办法通过 CIL 获取 interclass 的类型并将其更改为 public?

AssemblyDefinition x = AssemblyDefinition.ReadAssembly("x.dll");
TypeDefinition type = x.MainModule.GetType("Class");

最佳答案

AssemblyDefinition adef = AssemblyDefinition.ReadAssembly("x.dll");
TypeDefinition tdef = adef.MainModule.GetType("Class");
tdef.IsPublic = true;
adef.MainModule.Write("x_updated.dll");

关于c# - 将内部类更改为公共(public)类(CIL、Mono.Cecil),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30986508/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com