单击单步执行 Visual Studio
我正在尝试在这个网站上工作,但我对 Visual Studio 之类的东西有点陌生。每当我单击网站上的某些图标时,我希望执行一步操作。基本上它是很多代码,其中大部分是我正在学习的,并且我需要知道当我单击某些图标时我将控制发送到哪里。
有什么建议吗?
I am trying to work on this website and I am a bit new to Visual Studio and whatnot. I would like to have a step through action whenever I click on certain icons on the website. Basically it is a lot of code, most of which I am learning, and I need to know where I am sending control when I click certian icons.
Any tips?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在代码中插入断点(单击代码窗口的左边距)。然后,您的应用程序将停止,并且当代码遇到断点时,您将被发送到 Visual Studio 执行操作。当 VS 处于调试模式时,您还可以使用从断点开始逐行浏览应用程序的函数。
Insert break points in your code (click the left margin in the code windows). Your application will then stop, and you'll be sent to Visual Studio to do stuff when the code hits the break points. You also have functions to go through the app line by line from a break point when VS is in debug mode.
那么,您单击的按钮在代码隐藏文件中必须有一个单击事件处理程序。您可以通过按 F9 键或使用
Debug
> 转到该代码并添加断点。Toggle Breakpoint
,使调试器在执行该行代码时中断,之后您可以使用F10
键或使用Debug
>Step Over
在执行当前行后将调试器移动到下一行。调试时,您可以使用鼠标悬停来了解变量的值。Well, the
Button
that you click must have aClick Event Handler
in the code behind file. You can go to that code and add a break point by pressing F9 key or useDebug
>Toggle Breakpoint
, which makes debugger break when that line of code is executed, after which you can useF10
key or useDebug
>Step Over
to move debugger to next line after executing the current line. While debugging, you can use mouse hover to know values of variables.