Define contant and use it in Conditional attribute
#define LOG
using System;
using System.IO;
using System.Diagnostics;
class Starter {
static void Main() {
LogInfo(new StreamWriter(@"c:\logfile.txt"));
}
[Conditional("LOG")]
private static void LogInfo(StreamWriter sr) {
// write information to log file
}
}
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
-
-
-
-
-
-
-
-
|