VB 6到VB.Net与VB 6到C# [英] VB 6 to VB.Net versus VB 6 to C#

查看:81
本文介绍了VB 6到VB.Net与VB 6到C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我有一个用VB 6编码的项目。我需要支持unicode。要做到这一点,据我所知,我需要将VB 6代码转换为VB.Net或C#。所以,我有两个选择



a)将VB 6转换为VB.Net

b)将VB 6转换为c#



我想知道选择哪个选项以及为什么?




我的VB 6应用程序使用数据网格,文本框,按钮等控件,并将值从SQL数据库填充到这些控件中。



任何帮助都会被贬值。



问候,

joy

Hello everyone,

I have a project coded in VB 6. I need to support unicode. To do this, as I understand, I need to convert VB 6 code to either in to VB.Net or C#. So, I have two options

a) Convert VB 6 to VB.Net
b) Convert VB 6 to c#

I would like to know which option is beter to choose and why?


My VB 6 application uses controls like datgrids, textboxes , buttons etc and populates values into these contols from SQL database.

Any help will be apreciated.

Regards,
joy

推荐答案

C#和VB.NET之间的表达能力的功能差异和差异非常小。您可以轻松地自动进行翻译。好吧,通常,当语言增长时,C#比VB.NET领先一步。



然而,文化差异很大。因为在公众看来,VB.NET仍然与Visual Basic或Basic这个概念联系在一起,认为自己认真对待开发人员的软件开发人员通常认为VB.NET不是很严肃。无论为什么,VB.NET强烈排斥熟练或雄心勃勃的人,它吸引了那些在编程上感到有些不舒服的人,并认为基本应该是更容易(不清楚为什么)。当然,同样的事情发生在微软:C#是一个旗舰产品,并支持VB.NET,以保持市场上的定位针对那些有习惯在Basic上开发的开发人员。在ECMA下,C#和C ++ / CLI是标准化的主题,但我不能想象VB.NET是标准化的。



当然有一些实际意义。如果您寻求帮助或某些可用的开源.NET代码,在C#中查找内容要容易得多。这样的事情...



-SA
The functional differences and differences in expressive capabilities between C# and VB.NET are very minor. You can easily do translations between them automatically. Well, usually, when languages grow, C# goes a step ahead of VB.NET.

However, there is a big cultural difference. As, in public opinion, VB.NET is still associated with the notion "Visual Basic" or "Basic", it's very typical that software developers who consider themselves serious developers, don't consider VB.NET as something serious. VB.NET strongly repels skillful or just ambitious people, no matter why, and it attracts people who feel somewhat uncomfortable in programming and think that "Basic" is supposed to be "easier" (not clear why). Naturally, same thing happens in Microsoft: C# is a flagship product, and VB.NET is supported rather to keep the position on the market targeted to the developers who have the habits of developing on Basic. C# and C++/CLI are the subject of standardization, under ECMA, but I cannot imagine VB.NET to be standardized.

If of course has some practical implications. If you seek for help or for some available open-source .NET code, it's much easier to find something in C#. Things like that…

—SA


转换的机制是相同的您选择哪种语言:.NET控件与VB6控件不同,因此您不太可能在没有大量测试且可能令人头痛的情况下保留当前UI代码库的大部分(如果有的话)。



话虽如此,有自动转换工具可以将代码转换为VB或C#给你 - 一个非常快速的谷歌发现这个:VBUC [ ^ ]虽然我自己没有用过它。



就个人而言,我可能会用C#重新开发它,只是因为它消除了使用旧和不兼容的诱惑用VB.NET编写VB6编码方法 - 如果你必须在C#中编写,那么你最终会得到一个C#解决方案。如果你把VB6转到VB,那么你很容易得到一个既不适合语言的mashup。



取决于你:你对C#的熟悉程度如何? ?
The "mechanics" of the conversion are the same whichever language you choose: .NET controls are different from VB6 controls, so it is unlikely that you can keep much (if any) of your current UI code base without massive amounts of testing and probably headaches.

Having said that, there are automated conversion tools which will convert the code to VB or C# for you - a very quick google found this: VBUC[^] though I haven't used it myself.

Personally, I would probably hand re-develop it in C# if only because it removes the temptation to use "old" and incompatible VB6 coding methods with VB.NET - if you have to do it in C# then you will end up with a C# solution. If you go VB6 to VB, then you could easily end up with a "mashup" that suits neither language.

Depends on you though: How familiar are you with C#?


让我首先说我是一个彻头彻尾的C sharp程序员,我喜欢这种语言。我做了一些VB6,所以我至少熟悉你来自的世界。所以,说去C锐是很诱人的。但是我也有一位我尊敬的朋友,他发誓VB。



实际上,有更严肃的考虑因素 - 例如你进行转换的时间范围,你自己的关于学习新编程语言的目标,无论您是应用程序的唯一开发者,如果您是或将成为团队的一员,团队最有经验的语言是什么。



两种语言都将处理你必须使用的UI元素;如果您使用第三方UI控件集,您可以查看它们是否同时支持VB.Net和C sharp(我没有理由不这样做,因为控件只是.Net程序集中的代码 - 而且可以由两种语言同等引用)。同样,两种语言都使用相同的.Net框架,因此它们对SQL数据库的访问权限相同。并且,使用这些框架元素,无论是来自VB.Net还是C sharp,都将是一个相同的学习曲线。



我会说你最好搬到VB.Net因为在那条路上你只需要学习VB6和VB.Net之间的差异,而不是整个新语言。



你应该看看在 http://www.red-gate.com/products/dotnet-development/reflector/ [ ^ ]并查看它如何将.Net程序集拆分成几种.Net语言中的任何一种。您还应该使用可能有助于转换的Google工具。合适工具的可用性可能有助于影响您的决策。
Let me start by saying I'm an out-and-out C sharp programmer, and I love the language. I've done some VB6 so I at least am familiar with the world you're coming from. So, it would be tempting to say "go C sharp." But I also have a friend I respect who swears by VB.

Realistically, there are more serious considerations - such as the timeframe you have for making the conversion, your own goals regarding learnign a new programming language, whether you are the sole developer of the application, and if you are or will be part of a team, what is the language the team has the most experience with.

Both languages will cope with the UI elements you have to use; if you use a third-party set of UI controls you might take a look and see if they support both VB.Net and C sharp (I see no reason why not since a control is just code in a .Net assembly - and that can be referenced equally by both languages). Similarly, both languages use the same .Net framework, so they both have the same access to SQL database as each other. And, using those framework elements, whether from VB.Net or C sharp, will be an identical learning curve.

I'd say you are probably better off moving to VB.Net because on that path you only have to learn the delta between VB6 and VB.Net, not the whole of a new language.

You should take a look at http://www.red-gate.com/products/dotnet-development/reflector/[^] and look at how it can disassemble a .Net assembly into any of several .Net languages. You should also google tools that might help with your conversion. The availability of a suitable tool might help influence your decision.


这篇关于VB 6到VB.Net与VB 6到C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆