将 VB6 项目分成多个块以使用免费版本的 Artinsoft
我正在尝试将一个大型(200K 行)VB6 项目转换为C#。我只想转换表单设计,因为我想用 C# 重写所有实际代码。
我想使用免费的 Artinsoft 转换器,但这仅允许 10K 行的项目。我想我可以将 VB6 项目分成 20 个独立的项目,然后使用 Artinsoft 生成 C#.NET 表单,然后将转换后的表单带回到一个 C# 项目中。
这可行吗?
编辑:这会起作用吗?潜在的问题是什么?
I am trying to convert a large (200K lines) VB6 project into C#. I only want to convert the form design because I want to rewrite all the actual code in C#.
I want to use the free Artinsoft converter but this only allows projects of 10K lines. I am thinking I could break the VB6 project into 20 separate projects and then generate the C#.NET forms by using Artinsoft, then bringing the converted forms back into one C# project.
Is this feasible?
EDIT: Will this work? What are the potential problems?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我将按以下顺序尝试:
1)至少为主要业务操作编写自动化测试用例,
这将为您节省以后验证结果的麻烦。
2)重构你的VB(尝试将你的业务逻辑移出单独的类/DLL)。
3) 您可以使用步骤 1 中编写的自动化测试用例来验证您的重构。
4) 现在您有了小块,这也将帮助您创建块,然后您可以使用 Artinsoft。
5) 您的新 C# 应用程序将会很好地分层。
6) 在新应用程序和旧应用程序上运行步骤 1 中创建的测试,并比较结果并不断改进,除非它们匹配:)
I will try it in following order
1) Write automated test cases at least for major business operations
this will save you a lot of bother verifying the results later on.
2) Refactor your VB (try to move out your business logic in separate Classes/DLLs).
3) you can verify your re-factoring using automated test cases written in step 1.
4) Now you have small chunks this will also help you create chunks then you can use Artinsoft.
5) Your new C# application will be nicely layered.
6) Run tests created in step 1 on your new application and on your old application and compare results and keep improving unless they match :)
我建议不要使用 UI 转换器。它可能看起来微不足道,但有些功能根本不存在于 .NET 中(没有大数组包装器的控制数组)。而且它创建的控件包装器使用或维护起来并不有趣。
VB6 移植不好;用户界面或代码。如果您要继续沿着这条路走下去,有些事情可以提供帮助。
我会认真地重新考虑转换。转换后的代码/UI 听起来很棒,但根据我在 VB6 转换方面的糟糕经历,存在很多问题,因为 VB6 允许开发人员变得非常糟糕,并且功能根本不存在了。
帮自己一个大忙...开始一个新项目,创建一个继承自您使用的标准控件的自定义控件库,并在任何地方使用它们。不喜欢 Cliptext 在 C# 与 VB6 中的屏蔽文本框上的工作方式?扩展它或覆盖它。想要所有列表视图都可排序吗?简单的单点实施。一年后发现企业希望对 90% 的文本框进行拼写检查?简单的。
I would advise against using a converter for the UI. It may seem trivial, but there are features that simply do not natively exist in .NET (control arrays without a wrapper for a big one). And the control wrappers it creates are not fun to use nor maintain.
VB6 does not port well; the UI nor the code. If you were to continue down this path, there are things that can help.
I would seriously reconsider conversion. Converted code/UI sounds great, but in my bad experiences with VB6 conversion, there are so many problems because of how bad VB6 allowed developers to be and features that simply don't exist anymore.
Do yourself a huge favor... Start a new project, create a custom control library that inherits from the standard controls you use, and use those everywhere. Don't like the way Cliptext works on a masked textbox in C# versus VB6? Extend it or override it. Want all your listviews to be sortable? Easy, single-point implementation. Find out in a year that the business wants spell checking on 90% of textboxes? Easy.