从VB转换为C# [英] Converting from VB to C#
问题描述
我的任务是将一个解决方案,从VB到C#。有22个项目和数百个班,所以我决定去研究转换器。我终于尘埃落定SharpDevelop的,这是与包括转换器的IDE。我跑了它在我的每个项目,并有大量的错误修复,但我应该能够通过他们去,希望数字出来。我遇到的主要问题是与摘要日志。我有数以百计的各种类别的阅读行:
I was tasked with converting a solution from VB to C#. There were 22 projects and hundreds of classes, so I decided to research converters. I finally settled on SharpDevelop, which is an IDE with an included converter. I ran it on each of my projects, and have plenty of errors to fix, but I should be able to go through them and hopefully figure them out. The main issue I am having is with the summary log. I have hundreds of lines for various classes reading:
-- line 0 col 0: Case labels with binary operators are unsupported : Equality
-- line 0 col 0: Case labels with binary operators are unsupported : Equality
-- line 0 col 0: Case labels with binary operators are unsupported : Equality
-- line 0 col 0: Case labels with binary operators are unsupported : Equality
-- line 0 col 0: Case labels with binary operators are unsupported : Equality
我看着这件事,但我没有找到关于它的真正含义或如何纠正一个很好的解释。大部分我所看到的是评论道code线是这样说:
I've looked this up, but am not finding a good explanation on what it really means or how to correct it. most of what I find are lines of commented code that say something like:
// ERROR: Case labels with binary operators are unsupported : LessThan
40
可能有人请提供关于是什么原因导致这个错误的手段和如何纠正它提供更多的信息。谢谢你。
Could someone please provide a bit more information on what causes this error means and how to correct it. Thank you.
推荐答案
这意味着,在C#中有没有类似案例=
的<$ C(组成部分$ C>选择案例在VB)......当然除了真的有。
It means that in C# there is no equivalent for Case Is =
(part of a Select Case
in VB)... Except of course that there really is.
您可以改写:
Case Is = 999
为
case 999:
在C#。
实在是没有类似案例为&lt;
虽然,你将不得不重新编写与如果
There is really no equivalent for Case Is <
though, you'll have to rewrite that with if
.
这篇关于从VB转换为C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!