转换 VB.NET --> C# 项目
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/355340/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Convert VB.NET --> C# Projects
提问by Jayden
Can anyone recommend a good application that could be used to convert VB.NET projects to C#, without having to do too much manual work?
任何人都可以推荐一个好的应用程序,可以用来将 VB.NET 项目转换为 C#,而不必做太多的手工工作?
We've used Reflector to do small libraries manually, but some of the larger projects will be too slow and complex to do this manually.
我们已经使用 Reflector 手动完成小型库,但是一些较大的项目将太慢和太复杂而无法手动完成。
采纳答案by codymanix
You can use Lutz Roeders Reflector (http://www.red-gate.com/products/reflector) which can decompile whole Assemblies into Visual Studio projects. This way you can convert from ANY .NET Langauge into one of the supported languages of this program (C#.VB.NET,MC++,Delphi,Chrome)
您可以使用 Lutz Roeders Reflector ( http://www.red-gate.com/products/reflector),它可以将整个程序集反编译为 Visual Studio 项目。通过这种方式,您可以将任何 .NET 语言转换为该程序支持的语言之一(C#.VB.NET、MC++、Delphi、Chrome)
回答by recursive
SharpDevelophas this feature, but I haven't used it enough to know if works reliably. It seems to be a pretty good otherwise, so it's worth a try though.
SharpDevelop有这个功能,但我还没有使用它来知道它是否可靠。其他方面似乎还不错,所以值得一试。
回答by Jon Skeet
Tangible Softwaredo various converters, including VB to C#.
Tangible Software做各种转换器,包括 VB 到 C#。
I've played with it a little bit as they're kind enough to give me a copy for free, but I can't say I've stress-tested it. When I've used it it's been fine though - certainly worth a try.
我玩过它,因为他们很友好,可以免费给我一份副本,但我不能说我已经对其进行了压力测试。当我使用它时,它很好 - 当然值得一试。
回答by Binoj Antony
The best and fast converter I have seen so far is http://converter.telerik.com/
迄今为止我见过的最好和最快的转换器是http://converter.telerik.com/
Nicely presented using RAD AJAX Controls.
使用 RAD AJAX 控件很好地呈现。
Note: It converts only code snippets and not projects as a whole.
注意:它只转换代码片段,而不转换整个项目。
回答by Mark Maslar
A few things to keep in mind...
有几件事要记住...
1) Depending on how the VB.Net code was written, automatic conversion may or may not be 100% possible. VB.Net allows a "looser" coding style that would be ambiguous to C#. So, some manual intervention may be needed.
1) 根据 VB.Net 代码的编写方式,自动转换可能是也可能不是 100%。VB.Net 允许对 C# 不明确的“更宽松”的编码风格。因此,可能需要一些人工干预。
2) If the VB.Net code functions correctly, you may want to just leave it as VB.Net. Both VB.Net and C# projects can co-exist within the same solution.
2) 如果 VB.Net 代码运行正常,您可能只想将其保留为 VB.Net。VB.Net 和 C# 项目可以在同一个解决方案中共存。
回答by user42718
The far best tool for this is Econ Netvert which can be found on CodePlex http://www.codeplex.com/econnetvert
最好的工具是 Econ Netvert,它可以在 CodePlex http://www.codeplex.com/econnetvert上 找到
回答by James Crowley
There's also the free online converters up at developerfusion:)
回答by Co7e
SharpDevelop is quite good, but at my company we've found VBConversionsto provide a much more complete conversion. It's a commerical app though, but for the time saved over SharpDevelop it was a no-brainer for us.
SharpDevelop 非常好,但在我公司,我们发现VBConversions可以提供更完整的转换。虽然它是一个商业应用程序,但对于通过 SharpDevelop 节省的时间,这对我们来说是轻而易举的。
As a specific example, one thing we found that SharpDevelop didn't convert correctly was VB indexes, which use curvy brackets. It seemed unable to distinguish between indexes and method calls so didn't convert the indexes to square brackets. VBConversions converted them fine. This one thing made it worth its purchase for us.
作为一个具体的例子,我们发现 SharpDevelop 没有正确转换的一件事是 VB 索引,它使用了大括号。它似乎无法区分索引和方法调用,因此没有将索引转换为方括号。VBConversions 很好地转换了它们。这件事让我们值得购买。
It looks like the Tangible Software product works very similarly to VBConversions.
看起来有形软件产品的工作方式与 VBConversions 非常相似。