本文整理汇总了C#中Trace.WriteLine方法的典型用法代码示例。如果您正苦于以下问题:C# Trace.WriteLine方法的具体用法?C# Trace.WriteLine怎么用?C# Trace.WriteLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Trace
的用法示例。
在下文中一共展示了Trace.WriteLine方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Run
public int Run()
{
_trace = new Trace("StrSwitchFinalTest", _expected);
string[] s = {"one", "two", "three", "four", "five", "six"};
for(int i = 0; i < s.Length; i++)
{
beginloop:
try
{
try
{
try
{
switch(s[i])
{
case "one":
try
{
_trace.WriteLine("s == one");
}
catch
{
_trace.WriteLine("Exception at one");
}
break;
case "two":
try
{
_trace.WriteLine("s == two");
}
finally
{
_trace.WriteLine("After two");
}
break;
case "three":
try
{
try
{
_trace.WriteLine("s == three");
}
catch(System.Exception e)
{
_trace.WriteLine(e.ToString());
goto continueloop;
}
}
finally
{
_trace.WriteLine("After three");
try
{
switch(s[s.Length-1])
{
case "six":
_trace.WriteLine("Ok");
_trace.WriteLine(s[s.Length]);
goto label2;
default:
try
{
_trace.WriteLine("Ack");
goto label;
}
catch
{
_trace.WriteLine("I don't think so ...");
}
break;
}
label:
_trace.WriteLine("Unreached");
throw new Exception();
}
finally
{
_trace.WriteLine("After after three");
}
label2:
_trace.WriteLine("Unreached");
}
goto continueloop;
case "four":
try
{
try
{
_trace.WriteLine("s == " + s[s.Length]);
try
{
}
finally
{
_trace.WriteLine("Unreached");
//.........这里部分代码省略.........