Csharp/CSharp Tutorial/Preprocessing Directives/warning

Материал из .Net Framework эксперт
Перейти к: навигация, поиск

Unused Warning With Warning Suppressed

<source lang="csharp">using System; using System.Collections.Generic; using System.Text; using System.ruponentModel;

   class UnusedWarningWithWarningSuppressed
   {
  1. pragma warning disable 0169
       int x;
  1. pragma warning restore 0169
   }</source>

warning preprocessor

The #warning directive produces a warning.

The general form of the #warning directive is


<source lang="csharp">#warning warning-message</source>