using 指令有两个用途: 创建命名空间的别名(using 别名)。
允许在命名空间中使用类型,例如,不必限定该命名空间中的类型使用(using 指令)。MSDNms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.2052/csref/html/vclrfUsingDirective.htm
允许在命名空间中使用类型,例如,不必限定该命名空间中的类型使用(using 指令)。MSDNms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.2052/csref/html/vclrfUsingDirective.htm
解决方案 »
- 如何生成CMYK格式图像?
- asp.net 网站发布问题:Could not load the assembly 'App_Web_zokxwcif' 错误
- 50分求助:导航栏的下拉菜单从数据库里面读应该怎么办????
- 各位前辈好小的请教网页多媒体问题
- GridView中onrowcommand="CustomersGridView_RowCommand的事件中如何取得当前点击的是第几行,(不一定是选中的)
- 一个流媒体播放不支持中文URL的问题,急...
- 如何在asp.net中用c#编写弹出菜单??
- datagrid 页脚问题!
- 很初级的问题.
- 关于 System.IO.File.Delete
- 这么简单的一句代码为什么不执行啊?
- 不同域名之间怎么样传Cookies值,谁会?帮帮忙!
// cs_using_statement.cs
// compile with /reference:System.Drawing.dll
using System.Drawing;
class a
{
public static void Main()
{
using (Font MyFont = new Font("Arial", 10.0f), MyFont2 = new Font("Arial", 10.0f))
{
// use MyFont and MyFont2
} // compiler will call Dispose on MyFont and MyFont2 Font MyFont3 = new Font("Arial", 10.0f);
using (MyFont3)
{
// use MyFont3
} // compiler will call Dispose on MyFont3 }
}
{}
// 当达这时,程序会自动调 cn 的 Dispose 方法所以使用这种语法的类,必须实现 IDisposable 接口
using System.Data;
之类的用法这次大开眼界了