好吧,这是我有错误的代码:
this.terminchar = Convert.ToChar(8080);
List<string> source = new List<string>(this.base64Decode(parse_value).Split(new char[] { this.terminchar }));
if ((source) % 2) == 0)
{
for (int i = 0; i < source; i++)
{
this.keys.Add(source[i], source[++i]);
}
}
我在此代码中遇到3个错误,第一个错误:
Error 1 Operator '<' cannot be applied to operands of type 'int' and 'System.Collections.Generic.List'
第二个:
Error 2 Operator '%' cannot be applied to operands of type 'System.Collections.Generic.List' and 'int'
第三个:
Error 3 Invalid expression term '=='
我对C#相当陌生,这是我的 friend 源代码,我只是想了解其语法,但是我不知道该怎么做。给出的任何帮助将不胜感激,谢谢。
最佳答案
您正在对列表执行一些操作。我很确定,您应该按照以下步骤进行操作...
if ((source.Count) % 2) == 0)
和
for (int i = 0; i < source.Count; i++)
代替
关于c# - 如何在C#中修复这些错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7307198/