我的任务是将解决方案从 VB 转换为 C#。有 22 个项目和数百个类,所以我决定研究转换器。我最终选择了 SharpDevelop,这是一个带有转换器的 IDE。我在每个项目上都运行了它,并且有很多错误需要修复,但我应该能够检查它们并希望找出它们。我遇到的主要问题是摘要日志。我有数百行供各种课程阅读:
-- 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
我已经查过了,但没有找到关于它的真正含义或如何纠正它的良好解释。我发现的大部分内容都是注释代码行,内容如下:
// ERROR: Case labels with binary operators are unsupported : LessThan
40:
有人可以提供更多有关导致此错误的原因以及如何纠正它的信息吗?谢谢。
这意味着在 C# 中没有等效的Case Is =
(一部分Select Case
在 VB 中)...当然,确实存在。
你可以重写:
Case Is = 999
as
case 999:
in C#.
确实没有等效的Case Is <
不过,你必须重写它if
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)