首页 技术 正文
技术 2022年11月9日
0 收藏 795 点赞 4,619 浏览 2078 个字

  调试是软件开发过程中非常重要的一个部分,它具挑战性,但是也有一定的方法和技巧。

  Visual Studio 调试程序有助于你观察程序的运行时行为并发现问题。 该调试器可用于所有 Visual Studio 编程语言及其关联的库。 使用调试程序时,可以中断程序的执行以检查代码、检查和编辑变量、查看寄存器、查看从源代码创建的指令,以及查看应用程序占用的内存空间。

  本系列以 Visual Studio 2019 来演示调试的方法和技巧。希望能帮助大家掌握这些技巧。它们都很简单,却能帮你节约大量的时间。

Visual Studio 调试  —-  系列文章

调试方法与技巧Visual Studio 调试系列1 Debug 与 Release 模式Visual Studio 调试系列2 基本调试方法Visual Studio 调试系列3 断点Visual Studio 调试系列4 单步后退来检查旧应用状态(使用使用 IntelliTrace 窗口)Visual Studio 调试系列5 检查变量(使用自动窗口和局部变量窗口)Visual Studio 调试系列6 监视变量(使用监视窗口和快速监视窗口)Visual Studio 调试系列7 查看变量占用的内存(使用内存窗口)Visual Studio 调试系列8 查找导致程序崩溃的 DLL(使用模块窗口)Visual Studio 调试系列9 调试器提示和技巧Visual Studio 调试系列10 附加到正在运行的进程Visual Studio 调试系列11 远程调试Visual Studio 调试系列12 远程调试部署在远程计算机IIS上的ASP.NET应用程序 示例程序后续的调试以下面的程序为示例进行演示说明。Visual Studio 调试  —-  系列文章

 using System;
using System.Collections.Generic; namespace Demo002_NF45_CS50
{
class Program
{
static void Main(string[] args)
{
var shapes = new List<Shape>
{
new Triangle(,),
new Rectangle(,),
new Circle(), }; foreach (var shape in shapes)
{
shape.Width = ;
shape.Draw(); int num1 = , num2 = ;
num1 = num1 / num2; Console.WriteLine();
} Console.WriteLine("Press any key to exit."); // 在调试模式下保持控制台打开
Console.ReadKey();
}
} #region 调试示例 /// <summary>
/// 绘图类(基类)
/// </summary>
public class Shape
{
#region 属性 /// <summary>
/// X 轴坐标
/// </summary>
public int X { get; private set; } /// <summary>
/// Y 轴坐标
/// </summary>
public int Y { get; private set; } /// <summary>
/// 图形高度
/// </summary>
public int Height { get; set; } /// <summary>
/// 图形宽度
/// </summary>
public int Width { get; set; } #endregion // 绘制图形(虚方法)
public virtual void Draw()
{
Console.WriteLine("Performing base class drawing tasks");// 执行基类绘图任务
}
} /// <summary>
/// 圆形
/// </summary>
class Circle : Shape
{
public override void Draw()
{
Console.WriteLine("Drawing a circle"); // 绘制一个圆
base.Draw();
}
} /// <summary>
/// 矩形
/// </summary>
class Rectangle : Shape
{
public Rectangle()
{ } public Rectangle(int width, int height)
{
Width = width;
Height = height;
} public override void Draw()
{
Console.WriteLine("Drawing a rectangle"); // 绘制一个矩形
base.Draw();
}
} /// <summary>
/// 三角形
/// </summary>
class Triangle : Shape
{
public Triangle()
{ } public Triangle(int width, int height)
{
Width = width;
Height = height;
} public override void Draw()
{
Console.WriteLine("Drawing a trangle");// 绘制一个三角形
base.Draw();
}
} #endregion
}

Visual Studio 调试  —-  系列文章

==

出处:https://www.cnblogs.com/SavionZhang/p/11280516.html

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,085
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,560
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,409
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,182
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,819
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,902