C# 前置處理器指示詞C# preprocessor directives

本節包含下列 C# 前置處理器指示詞的相關資訊:This section contains information about the following C# preprocessor directives:

如需詳細資訊和範例,請參閱個別主題。See the individual topics for more information and examples.

雖然編譯器沒有另外的前置處理器,但處理本節中所述的指示詞時,會像是有前置處理器一樣。Although the compiler doesn't have a separate preprocessor, the directives described in this section are processed as if there were one. 這些指示詞可用於協助條件式編譯。They are used to help in conditional compilation. 不同於 C 和 C++ 指示詞,您無法使用這些指示詞來建立巨集。Unlike C and C++ directives, you cannot use these directives to create macros.

每個前置處理器指示詞都必須是該行中的唯一指令。A preprocessor directive must be the only instruction on a line.

另請參閱See also