您的位置:首页 > 其它

设置DebuggerStepThrough属性,使单步跟踪跳过指定函数。

2008-07-16 14:48 260 查看
DebuggerStepThrough属性能使单步跟踪在制指定的函数失效。如:

private void button1_Click(object sender, EventArgs e)

{

myMethod();

}

//设置单步跟踪失效的属性

[System.Diagnostics.DebuggerStepThrough]

private void myMethod()

{

Console.WriteLine("Is this method executed?");

}

上面的代码中,单步跟踪(F11)的时候不能进入myMethod函数。但是如果里面有断点,将直接走向断点处。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: