【问题标题】:Operator '<' cannot be applied to operands of type 'long' and 'ulong'运算符“<”不能应用于“long”和“ulong”类型的操作数
【发布时间】:2014-05-27 09:23:52
【问题描述】:

我使用了 redgate 的 .NET Reflector 8,并使用了将 .dll 导出到 C# 文件的功能,但我遇到了一种错误情况,我不知道如何修复此错误。

错误状态:错误 36 运算符“

我知道错误与按位有关,但我不确定如何解决具体情况。

if (!flag && (num7 < (((ulong) endLocation) - (((ulong) 4L) + num6))))
         {
           this.offsetOfFirstEntry = endLocation - ((4L + ((long) num6)) + num7);
              if (this.offsetOfFirstEntry <= 0L)
                    {
                        throw new ZipException("Invalid embedded zip archive");
                    }
}

这是错误的快照:

解决此类错误的最佳方法是什么?

【问题讨论】:

标签: c# binary-operators .net-reflector ulong


【解决方案1】:

num7 转换为ulong 怎么样?

if (!flag && ((ulong)num7 < (((ulong) endLocation) - (((ulong) 4L) + num6))))

顺便说一句,这与位运算符无关。

【讨论】:

  • 刚注意到,和按位无关,应该是早期的大脑还没醒。这很好用,谢谢。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2023-04-07
  • 2022-06-11
  • 1970-01-01
  • 1970-01-01
  • 2019-08-27
  • 2021-07-27
  • 2020-10-19
相关资源
最近更新 更多