在用C#编写Windows应用程序时,Dispose()的正解?
2006-06-03 20:57
288 查看
我们在.net环境下编写Windows应用程序时,系统会自动加载一个Dispose函数,如下:
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
它的作用是:释放有ApplicationContext使用的资源。
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
它的作用是:释放有ApplicationContext使用的资源。
相关文章推荐
- C#窗体-个人简历生成(自己设计并编写一个 Windows 应用程序,要求用到TextBox、GroupBox、RadioButton )
- C#编写Windows桌面应用程序弹出对话框取得文件名
- C#编写Windows桌面应用程序播放MP3声音文件
- C#编写Windows桌面应用程序在窗体上滚动字幕
- 编写C#程序-Windows Application应用程序
- C#编写Windows桌面应用程序删除ArrayList里面的元素
- C#编写Windows桌面应用程序使程序同时只能运行一个副本
- C#编写Windows应用程序的一般过程
- C#编写Windows桌面应用程序打印文本文件
- C#编写Windows桌面应用程序读取执行文件当前路径
- 利用Timer控件【Timer(6.4.9)】编写C# Windows应用程序,设计一个如下效果电子时钟。
- C#编写Windows桌面应用程序窗口全屏显示
- C#编写最小化到系统托盘的Windows应用程序
- [转贴]C#编写隐藏在任务栏图标的Windows应用程序
- 用C#编写的Windows应用程序如何控制TextBox中只能输入数字?
- C#编写Windows桌面应用程序窗体上放置图片
- 第3章 用C#编写Windows应用程序
- C#编写最小化到系统托盘的Windows应用程序
- 《C#高级编程(第8版)》之用C# 2012和.NET 4.5编写Windows 8样式应用程序技巧
- C#编写C/S端代码,Windows应用程序 --- 初接触(二)