2011-04-15 112 views

回答

3

「應用程序輸出」窗口將顯示Console.WriteLine的結果。

如果你想要的東西與Visual Studio的Windows,以及,它作爲單聲道,然後添加一個靜態方法類似下面您的Program.cs文件:

public static void WriteLine(String fmt, params Object[] args) 
    { 
     string op; 
     if (fmt == null) 
      op = String.Empty; 
     else if (args == null || args.Length == 0) 
      op = fmt; 
     else 
      op = String.Format(fmt, args); 
     Trace.WriteLine(op); 
     DateTime now = DateTime.Now; 
     string outString = String.Format("{0,4}-{1,2:0#}-{2,2:0#} {3,2:0#}:{4,2:0#}:{5,2:0#} : {6}", 
      now.Year, now.Month, now.Day, 
      now.Hour, now.Minute, now.Second, 
      op); 
     Console.WriteLine(outString); 
    } 
0

默認跟蹤監聽器寫入系統.Diagnostics.Debugger.Log,僅在Mono HEAD中受支持。

如果您希望看到調試器外部的輸出或使用較舊版本的Mono,請添加一個寫入控制檯的自定義跟蹤偵聽器。

+3

還只在HEAD中? – Henrik 2012-01-18 08:24:55