c# - C# 中的代码好奇心

标签 c# label goto

我正在查看 YUI Compressor并在 ECMA.NET 项目中遇到了这段代码(如果您有兴趣,请继续阅读文件)。

protected internal override int FindPrototypeId (string s)
    {
        int id;
        #region Generated PrototypeId Switch
    L0: {
            id = 0;
            string X = null;
            if (s.Length == 11) { X = "constructor"; id = Id_constructor; }
            if (X != null && X != s && !X.Equals (s))
                id = 0;
        }
    EL0:
        #endregion
        return id;
    }

我不知道 L0: 和 EL0: 在这里做什么,以前从未见过。这个术语对于谷歌来说似乎也太初级了。

有人知道吗?

最佳答案

它们看起来像用作 goto 目标的标签。参见 http://msdn.microsoft.com/en-us/library/13940fs2.aspx获取更多信息。

关于c# - C# 中的代码好奇心,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/727469/

相关文章:

c# - 升级到 ASP.NET Core 2.2 后如何配置 Azure 日志记录

macos - 使用 AppleScript 为文件设置标签

Python tkinter - 动态更改标签字体颜色

c# - MVC中使用webbackgrounder nuget长时间运行后台任务

C# JsonConverter 无法从 JsonResult 反序列化对象

c - 跳入 C 中的一个 block

带有goto命令的windows批处理文件不起作用

c - 在 C 中使用 GOTO 进行 FSM

c# - if 中的 Out 参数被认为是未分配的

python - 为什么配置框架的宽度与标签的宽度有所不同?