C# 错误 - 未实现接口成员

C# Error - Does not implement interface member

我有一个用 C# 编写的混淆代码,我需要构建并制作一个 exe。但是,在 VS 2012 中构建项目时出现错误。错误显示:

错误:

xf1555389a70c7d5a.x39b8e005139a3d89.xdd6080d77f5137d7' does not implement interface member 'System.Collections.IEnumerable.GetEnumerator()'. 'xf1555389a70c7d5a.x39b8e005139a3d89.xdd6080d77f5137d7.GetEnumerator()' cannot implement 'System.Collections.IEnumerable.GetEnumerator()' because it does not have the matching return type of 'System.Collections.IEnumerator'.

File: x39b8e005139a3d89.cs

这里是xdd6080d77f5137d7.cs文件混淆代码:

public class xdd6080d77f5137d7 : IEnumerable<x39b8e005139a3d89.xe657754b6d8c9c0b>, IEnumerable, IComparable, x39b8e005139a3d89.xe657754b6d8c9c0b
    {
      private readonly LOG_CODES _x9035cf16181332fc;
      private readonly BOARDS _x337e217cb3ba0627;
      private readonly DeviceMode _xa4aa8b4150b11435;

  public LOG_CODES xdc1af3a17717bf0a
  {
    get
    {
      return this._x9035cf16181332fc;
    }
  }

  public BOARDS xaf77e81a71d6921f
  {
    get
    {
      return this._x337e217cb3ba0627;
    }
  }

  public DeviceMode xad98d2ceb0921f0a
  {
    get
    {
      return this._xa4aa8b4150b11435;
    }
  }

  public xdd6080d77f5137d7(LOG_CODES code, BOARDS source, DeviceMode mode)
  {
    this._x9035cf16181332fc = code;
    this._x337e217cb3ba0627 = source;
    this._xa4aa8b4150b11435 = mode;
  }

  public xdd6080d77f5137d7(LOG_CODES code, DeviceMode mode)
  {
    this._x9035cf16181332fc = code;
    this._x337e217cb3ba0627 = BOARDS.boardNULL;
    this._xa4aa8b4150b11435 = mode;
  }

  public xdd6080d77f5137d7(LOG_CODES code, BOARDS source)
  {
    this._x9035cf16181332fc = code;
    this._x337e217cb3ba0627 = source;
    this._xa4aa8b4150b11435 = DeviceMode.None;
  }

  public xdd6080d77f5137d7(LOG_CODES code)
  {
    this._x9035cf16181332fc = code;
    this._x337e217cb3ba0627 = BOARDS.boardNULL;
    this._xa4aa8b4150b11435 = DeviceMode.None;
  }

  public int CompareTo(object obj)
  {
    x7ba9346687691c4e.x4e846d09fe48634b(obj is x39b8e005139a3d89.xdd6080d77f5137d7, "Wrong data type");
    x39b8e005139a3d89.xe657754b6d8c9c0b xe657754b6d8c9c0b = (x39b8e005139a3d89.xe657754b6d8c9c0b) obj;
    if (this.xdc1af3a17717bf0a > xe657754b6d8c9c0b.xdc1af3a17717bf0a)
      return 1;
    if (this.xdc1af3a17717bf0a < xe657754b6d8c9c0b.xdc1af3a17717bf0a)
      return -1;
    if (this.xaf77e81a71d6921f > xe657754b6d8c9c0b.xaf77e81a71d6921f)
      return 1;
    if (this.xaf77e81a71d6921f < xe657754b6d8c9c0b.xaf77e81a71d6921f)
      return -1;
    if (this.xad98d2ceb0921f0a > xe657754b6d8c9c0b.xad98d2ceb0921f0a)
      return 1;
    return this.xad98d2ceb0921f0a < xe657754b6d8c9c0b.xad98d2ceb0921f0a ? -1 : 0;
  }

  public IEnumerator<x39b8e005139a3d89.xe657754b6d8c9c0b> GetEnumerator()
  {
    throw new Exception("The method or operation is not implemented.");
  }

  IEnumerator IEnumerable.x05b0b83b5e6c5de6() // Also, I am getting Error at this Line. The error is: 'IEnumerable.x05b0b83b5e6c5de6' in explicit interface declaration is not a member of interface.
  {
    throw new Exception("The method or operation is not implemented.");
  }
}

请查看有 2 个错误(第一个错误在 File x39b8e005139a3d89.cs 上方,另一个错误在 xdd6080d77f5137d7.cs 文件的末尾。)

显然名称必须是 IEnumerable.GetEnumerator 而不是 IEnumerable.x05b0b83b5e6c5de6

参见:IEnumerable Interface