Syn*_*ter 0 debugging visual-studio
考虑我有一个窗口应用程序,在Visual Studio 2005中开发,有一个按钮.
当按钮被点击第三次(或第n次)而不是第一次时,我需要使用"运行到光标"/调试.我怎样才能做到这一点.?
考虑这是一个示例代码.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace breakPoint
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
for (int i = 0; i < 10; i++)
{
textBox1.Text += "hi ";
textBox2.Text += "hello ";
textBox3.Text += "bye ";
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
当我第n次单击按钮时,我需要在"textBox1.Text"行插入断点.
您不能使用Run to Cursor,但可以使用断点.
断点现在只会在第N次击中时停止.
编辑
回应澄清.然后将断点放在实际的函数声明本身上.每次点击只会执行一次.然后,您可以进入循环并点击所需的位置.
| 归档时间: |
|
| 查看次数: |
208 次 |
| 最近记录: |