从 dll 恢复 WinForms
我们认为大部分源代码已通过 .NET Reflector 恢复。将 dll 导出为 C# 源的实用程序。
唯一缺少的部分是 WinForms,当 .NET Reflector 导出 dll 源时,它不包含在内。
有什么方法可以让 WinForms 从 dll 中恢复吗?
谢谢。
We think most of the source has been recovered through .NET Reflector. A utility which export the dll as C# source.
The only missing part is WinForms which is not included when .NET Reflector export the dll source.
Is there any way to get the WinForms recover from dll?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果它不在 dll 中,则无法将其取出:-)
但可能某些类文件就是您正在搜索的形式。也许您必须将对 System.Windows.Forms.dll 的引用添加到您的项目中。
If it's not in the dll, you can't get it out :-)
But possible some class files are the forms you're searching for. Maybe you have to add a reference to System.Windows.Forms.dll to your project.
从 Visual Studio 2005 开始,Windows 窗体类是部分类,分为设计器生成的部分 (MyForm.designer.cs) 和实际实现 (MyForm.cs)。当您从头开始创建新表单时,您可以在资源管理器中看到这一点。
为了解决您的问题,您必须以与 Visual Studio 相同的方式拆分 Reflector 导出的类:将
InitializeComponent()
方法和所有控件声明放入 MyForm.designer.cs 文件中并将其余代码放入 MyForm.cs 文件中。From Visual Studio 2005 on, Windows Forms classes are partial classes split into a Designer generated part (MyForm.designer.cs) and your actual implementation (MyForm.cs). You can see that in Explorer when you create a new Form from scratch.
In order to resolve your problem you would have to split up the class exported by Reflector the same way that Visual Studio does: Place the
InitializeComponent()
method and all control declarations into the MyForm.designer.cs file and the remaining code into the MyForm.cs file.