如何将VB5项目转换为ac#项目

发布于 2024-07-12 04:22:52 字数 99 浏览 7 评论 0原文

我有一个 VB5(非 .net)项目,我想将其升级到 ac# 项目。 有没有人对可以帮助我解决这个问题的方法或免费工具有任何建议。

谢谢

布拉德

I have a VB5 (non .net) project that I would like to upgrade to a c# project. Has anyone have any suggestions on methods or free tools that are avalible to help me with this.

Thanks

Brad

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

明月夜 2024-07-19 04:22:53

我自己完成此操作后,我谈论了所涉及的问题 这里。

基本上,作为 ocdecio,您至少会看到部分重写。 您可能需要重构表单以尽可能多地从中移出代码。 您还需要重构任何 VB6 特定功能,以便在可以在 .NET 中重新实现的接口后面工作。 特别是图形命令和打印机功能。 对于任何严肃的项目来说,迁移工具通常毫无价值。

Having done this myself I talk about the issues involved here.

Basically as ocdecio you are looking at least a partial rewrite. You will likely need to refactor your forms to move as much code out of them as possible. You will also need to refactor any VB6 specific features to work behind a interface that you can reimplement in .NET. Notably the Graphics commands, and the Printer functions. Migration Tools are usually worthless for any serious project.

古镇旧梦 2024-07-19 04:22:52

直接重写会更好。

You are better off with a straight rewrite.

—━☆沉默づ 2024-07-19 04:22:52

我建议首先将项目转换为 VB6。 从那里继续前进会容易得多。 有许多工具可以帮助您做到这一点。 有 VBMigration 合作伙伴,还有 vbto。 我也没试过所以YMMV。

如果成本是一个限制,您可以尝试以下操作:Visual Studio 中有一个向导会尝试将 VB6 升级到 VB.NET。 它不是 100% 准确,您必须为 VB.NET 不支持的内容编写代码,例如控件数组等。一旦代码位于 VB.NET 中,您就可以使用 SharpDevelop 将 VB.NET 转换为 C#。 这会有点乏味,但我想条条大路,无论多么曲折,都通罗马。

What I would suggest is first convert the project to VB6. It'll be much easier to go forward from there. There are a number of tools to help you do this. There is VBMigration Partner and there is vbto. I've not tried either so YMMV.

If costs are a constraint you could try this: there is a wizard in Visual Studio that will attempt to upgrade VB6 to VB.NET. It's not 100% accurate and you WILL have to write code for things VB.NET does not support such as control arrays, etc. Once the code is in VB.NET you can use a tool like SharpDevelop to convert the VB.NET to C#. It'll be a bit tedious but i suppose all roads, no matter how convoluted, lead to Rome.

南城旧梦 2024-07-19 04:22:52

如果您能够将其迁移到 VB6,您可以使用代码顾问 查看如何修复您的项目以兼容 vb.net,然后您可以迁移到 vb.net,如果成功,您可以使用 工具可将其转换为 c# 或 反射器

我给它 1x10^(-100)% 的工作机会。
祝你好运。

In case you were able to migrate it to VB6 you can use the code advisor to see how you can fix your project to be compatible to vb.net, then you can migrate to vb.net, in case it success, you can use this tool to convert it to c# or the Reflector.

I give it a chance of 1x10^(-100)% to work.
Good luck.

朕就是辣么酷 2024-07-19 04:22:52

如果您要将 VB5 转换为 .NET(无论是 C# 还是 VB.NET),最快的方法是从 0 重新启动您的实现,以便您可以充分利用 .NET Framework 类。 我不知道是否有工具可以自动进行此转换。

If you're about to convert VB5 to .NET (whether it's C# or even VB.NET) the fastest way is to restart from 0 your implementation so you can take full advantage of .NET Framework classes. I don't know if there are tools to do this conversion automatically.

冷心人i 2024-07-19 04:22:52

从一种语言到另一种语言的严格转换并不是一个好主意,特别是当它们与 VB5 和 C# 一样不同时。

理论上,您可以将 VB5 转换为 VB6,然后将 VB6 转换为 VB.NET,然后将 VB.NET 转换为 C#,但当我打字时,这对我来说听起来很疯狂。

C# 比 VB5 强大得多,您无论如何都不想隐藏代码。 毕竟,由于 VB 的 OO 能力较弱,它的设计很可能很差。

相反,我建议用 C#(或您想要使用的任何其他语言)重新实现您需要的功能。

It's rarely a good idea to do a strict conversion from one language to another, particularly when they are as different as VB5 and C#.

Theoretically, you could convert VB5 to VB6 and then VB6 to VB.NET and then VB.NET to C#, but that just sounds crazy to me as I type it.

C# is so much more powerful than VB5 that you wouldn't want to covert the code anyway. After all, it likely has a poor design due to VB's weak OO capabilities.

I'd instead recommend re-implementing the functionality you need in C# (or whatever other language you want to use).

深海夜未眠 2024-07-19 04:22:52

我知道有一个转换工具,但不确定是否有 vb5 的转换工具。

不过,我建议重新设计该项目,利用 vb5 中不可用的 .net 功能。 特别是对于 OO 语言来说,重新设计会很好。

I know there exist a conversion tools, not sure though if there are some for vb5.

However, i'd recommend performing a redesign of the project, taking advantage of the .net features unavaiable in vb5. Specially it would be good redesigning for a OO language.

不一样的天空 2024-07-19 04:22:52

只是为了拥有 .NET 而将 VB5 迁移到 C# 从来都不是一个好的理由。 我更愿意仔细看看我在 VB5 版本中所做的假设和设计决策,重新思考它们,添加新想法,绘制 UI 草图并改进它,使其看起来更接近现代 UI。

然后这是一个新项目,我什至不会将其称为重写,因为会有很多变化。

Migrating VB5 to C# just to have .NET is never a good reason. I would prefer to have a good look at the assumptions and design decisions I made in the VB5 version, rethink them all, add new ideas, sketch the UI and improve it to look closer to a modern one.

Then it's a new project, I wouldn't even call it a rewrite, because so much would have changed.

深海里的那抹蓝 2024-07-19 04:22:52

我已将一个小型的 1 层 VB6 应用程序迁移到 C#,并且我再也不会这么做了。

有一些应用程序可以很好地从 VB6 迁移到 VB.Net。

//马格努斯

I've migrated a small 1-tier VB6 application to C# and I will never do it again.

There are applications out there that do a rather good job migrating from VB6 to VB.Net.

//Magnus

尴尬癌患者 2024-07-19 04:22:52

我过去曾经这样做过,但不推荐这样做。 在“自动迁移”之后让项目正常工作是不值得的。 我最终重写了程序,并因此变得更好。

I’ve done it in the past but don’t recommend it. Getting the project to work correctly after the ‘auto-migration’ was not worth the effort. I ended up rewriting the program and was better off because of it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文