简体   繁体   English

有遗留的VB6代码需要转换为VB.net

[英]Have legacy VB6 code that needs to be converted to VB.net

So I have a rather complicated application written in legacy VB6 that I have been tasked to update to current VB.net to work on more machines. 所以我在遗留VB6中编写了一个相当复杂的应用程序,我的任务是更新到当前的VB.net以在更多的机器上工作。

My question is if it would be easier to attempt to find a converter to do it rather efficiently or should I bite the bullet and attempt to take the rest of the summer to rewrite this beast of an application? 我的问题是,如果尝试找到一个转换器来更有效地完成它,或者我应该咬紧牙关并试图在夏天的剩余时间里重写这个应用程序的野兽会更容易吗?

I am not a programmer by trade (physicist, actually) and I have minimal experience working with VB since high school... Any advice is greatly appreciated! 我不是贸易程序员(物理学家,实际上),我从高中开始就没有使用VB的经验......任何建议都非常感谢!

A converter will likely take less time to get you to a working end result, but it will still likely require a lot of fixes. 转换器可能需要更少的时间才能达到工作结果,但仍可能需要大量修复。 However, in the end, you'll end up with even uglier code than it probably already is. 但是,最终,你最终会得到比它可能已经存在的更丑陋的代码。 If you have the time and ability to do so, it's a great opportunity to redesign the code as you translate it into the new language. 如果您有时间和精力这样做,那么在将代码翻译成新语言时,这是一个重新设计代码的绝佳机会。 There are many new features in VB.NET that likely won't get utilized if you use a converter. 如果使用转换器,VB.NET中有许多新功能可能无法使用。 It's just a matter of what's more important in your situation: speed, or quality. 这只是在你的情况下更重要的问题:速度或质量。

If you do decide to go with using a conversion tool, I would definitely visit the Microsoft Visual Basic 6.0 Migration Resource Center . 如果您决定使用转换工具,我肯定会访问Microsoft Visual Basic 6.0迁移资源中心 They have links to a Visual Basic 6.0 to Visual Basic .NET Upgrade Assessment Tool -- which you can use to evaluate your VB6 code prior to conversion -- and other information. 它们具有指向Visual Basic 6.0到Visual Basic .NET升级评估工具的链接 (可用于在转换之前评估VB6代码)以及其他信息。

Your two main options are to use the Conversion Wizard that comes with Visual Studio 2005 or 2008 -- MSFT didn't include it in VS 2010! 您的两个主要选项是使用Visual Studio 20052008附带的转换向导 - MSFT未在VS 2010中包含它! -- or to use the free copy of ArtinSoft's Visual Basic Upgrade Companion (VBUC) . - 或使用ArtinSoft Visual Basic Upgrade Companion(VBUC)的免费副本。 I would recommend the latter -- it appears to be more sophisticated than the MSFT VS Wizard -- but it will only freely convert a project that has up to 10,000 lines of code. 我会推荐后者 - 它似乎比MSFT VS向导更复杂 - 但它只能自由转换一个具有多达10,000行代码的项目。 Any more than that, and you'll have to shell out $$ for a license. 除此之外,您还必须为许可证支付$$。

I am not a programmer by trade 我不是贸易程序员

If you want to learn VB.Net and are not easily intimidated by massive projects, do the conversion yourself. 如果您学习VB.Net并且不容易被大型项目吓倒,请自行进行转换。 Depending on the scope of the application, you can perform the conversion in steps although it is painful (and I don't recommend it). 根据应用程序的范围,您可以逐步执行转换,尽管它很痛苦(我不推荐它)。

Otherwise, a conversion tool is what I recommend. 否则,我建议使用转换工具。 I'm not a VB.Net, so others may have some better advice. 我不是VB.Net,所以其他人可能会有更好的建议。 I do not expect that a conversion tool would be 100% accurate but should provide a very easy platform for continuing the conversion. 我不认为转换工具会100%准确,但应该提供一个非常简单的平台来继续转换。

Another option is to hire a conversion company. 另一种选择是聘请转换公司。 The one we chose is called CodeArchitects. 我们选择的那个叫做CodeArchitects。 They provide a conversion engine and or consultation services that provide a turnkey solution (http://www.vbmigration.com/). 他们提供转换引擎和/或咨询服务,提供交钥匙解决方案(http://www.vbmigration.com/)。 I had them convert an vb6 application to vb.net for my company. 我让他们将vb6应用程序转换为我公司的vb.net。 That went pretty well and the cost was less than if i took months away (from development/enhancment etc) to do it myself. 这很顺利,成本低于我花了几个月的时间(从开发/增强等)自己做。 One note is that you will not get the learning experience from actually doing it yourself (i am transitioning from vb6 to vb.net, finally). 需要注意的是,您不会自己实际学习(我最终会从vb6过渡到vb.net)。 Hope this helps.. 希望这可以帮助..

My experience is that automatic converters do not do a good job of doing this kind of thing. 我的经验是,自动转换器不能很好地完成这类工作。

Although it seems like a daunting task I would suggest hand coding is preferable. 虽然这似乎是一项艰巨的任务,但我建议手工编码更可取。 However - do not underestimate this task either. 但是 - 不要低估这个任务。

I personally would be nervous of someone who (by their own admission) wasn't a programmer doing this work. 我个人会担心某人(他们自己承认)不是一个程序员从事这项工作。

If you have not done already download the Microsoft Code Advisor Add-In - this will alert you to some of the more glaring issues that need addressing before embarking on an upgrade. 如果您还没有下载Microsoft Code Advisor加载项 - 这将提醒您在开始升级之前需要解决的一些更明显的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM