简体   繁体   English

#region描述编译成.net中的.exe?

[英]#region descriptions compiled into .exe in .net?

Are #region/#endregion directive "descriptions" compiled into the .EXE in .NET? #region / #endregion指令“描述”是否已编译到.NET中的.EXE中? I understand that comments are NOT, but I often chunk groups of code within a region and give it a useful description. 我知道评论不是,但我经常在一个区域内组合代码组并给它一个有用的描述。

I want to make sure these descriptions are not visible in my compiled code. 我想确保在我的编译代码中看不到这些描述。 (I am not looking for obfuscation information. Thanks, though.) (我不是在寻找混淆信息。不过,谢谢。)

No, they aren't. 不,他们不是。 They are Preprocessor expressions, which won't end up in code. 它们是预处理程序表达式,不会以代码结尾。

No, they're not. 不,他们不是。 Region descriptions are basically comments, and aren't included in either the assembly itself or the PDB. 区域描述基本上是注释,并且不包含在程序集本身或PDB中。

Region is the one of C# Preprocessor Directives. Region是C#预处理器指令之一。

Although the compiler does not have a separate preprocessor, the directives described in this link 虽然编译器没有单独的预处理器,但此链接中描述的指令

http://msdn.microsoft.com/en-us/library/ed8yd1ha(v=vs.110).aspx http://msdn.microsoft.com/en-us/library/ed8yd1ha(v=vs.110).aspx

are processed as if there were one. 处理好像有一个。

But I wonder that, what is the aim of this question? 但我想知道,这个问题的目的是什么? :) :)

No, they aren't. 不,他们不是。 They are like comments. 他们就像评论。 Look at Pre-processing directives 查看预处理指令

The pre-processing directives provide the ability to conditionally skip sections of source files, to report error and warning conditions, and to delineate distinct regions of source code. 预处理指令提供了有条件地跳过源文件部分,报告错误和警告条件以及描述源代码的不同区域的能力。 The term "pre-processing directives" is used only for consistency with the C and C++ programming languages. 术语“预处理指令”仅用于与C和C ++编程语言的一致性。 In C#, there is no separate pre-processing step; 在C#中,没有单独的预处理步骤; pre-processing directives are processed as part of the lexical analysis phase . 预处理指令作为词法分析阶段的一部分进行处理。 Pre-processing directives are not tokens and are not part of the syntactic grammar of C# . 预处理指令不是令牌,也不是C#语法语法的一部分 However, pre-processing directives can be used to include or exclude sequences of tokens and can in that way affect the meaning of a C# program. 但是,预处理指令可用于包含或排除令牌序列,并且可以以这种方式影响C#程序的含义。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM