目次
C# デバッグを行う
System.Diagnostics.Debug を利用する。
- System.Diagnostics 名前空間には、システム プロセス、イベント ログ、およびパフォーマンス カウンタと対話するためのクラスが用意されている
EventLog
- イベント ログへの書き込み、読み取りなど
Process
- ネットワークを通じてシステム プロセスを監視し、ローカル システム プロセスを開始および終了する機能
PerformanceCounter
- システム パフォーマンスを監視
Debug
- コードのデバッグに使用
- 例
public void Hoge() { int i = 0; Debug.WriteLine("Starting My Application"); Debug.Indent(); Debug.WriteLine("Entering second step.","information"); Debug.Assert(i != 0, "i is not 0."); }
- 結果
YAGI Hiroto (piroto@a-net.email.ne.jp)
twitter http://twitter.com/pppiroto
Copyright© 矢木 浩人 All Rights Reserved.