框架概览
.NET Framework 主要包括两个部分:CLR(通用语言进行时)和FCL(框架类库)。其中CLR是.NET Framework的基础,提供了包括内存管理,线程管理和远程处理等核心服务;FCL是一个机遇面向对象的可重用类型集合,用于支持多种应用的快速开发,例如:ASP.NET WEB 应用,Windows Form应用,Web Services应用和企业服务等多种应用与服务。
.NET 技术的认知和深入,建立在两个基本的方面:
- .NET 基本知识和底层机制的研究
- .NET 类库的了解和熟练
常用的命名空间
1. using System.Collections;
有ArrayList;Hashtable;Stack;Queue;DictionaryEntry;等集合
using System.Reflection;
获取Assembly 的属性值using System.Data;
访问和操作数据库等类using System.Drawing;
图像,画笔,和gdiusing System.IO;
对文件、文件夹的操作using System.Media;
播放wav和系统wav文件using System.Net;
操作网络using System.Runtime;
运行时的各种信息using System.Security;
用于安全和加密
10.using System.Text;
各种编码方式和正则表达式
11.using System.Threading;
多线程
12.using System.Web;
asp.net的web编程
13.using System.Windows.Forms;
各种控件
14.using System.Xml;
操作xml文件
常用类
Microsoft.Win32.Registry
操作注册表System.Runtime.InteropServices.Marshal
操作内存System.Enum;
操作枚举System.DateTime;
操作时间System.Math;
操作数字类System.Runtime.Serialization
用于序列化和反序列化System.Windows.Forms.Clipboard;
操作剪贴板DateTime.IsLeapYear(“1990”);
判断是否为闰年System.Text.RegularExpressions.Regex.IsMatch(“字符串”,”正则表达式”);
判断正则,返回bool型Console.CapsLock;
获取caps_lock键,是否按下System.Environment;
System.Windows.Forms.SystemInformation;
获取系统信息System.Array;
操作数组,排序,倒序等System.Windows.Forms.Screen s = Screen.PrimaryScreen;
获取显示器信息System.Guid.NewGuid();
获取新的guidSystem.Random r = new Random();
r.Next();
产生随机数System.Drawing.Point p = new Point(100,200);
System.Drawing.Size s = new Size(500,600);
位置和大小System.Threading.Thread.Sleep(3000);
延迟三秒System.Drawing.Point p = MousePosition;
获取当前鼠标坐标