天天看點

C#常用命名空間和類

常用命名空間:

using System;  //主命名空間

using System.Collections.Generic;  //泛型集合接口和類

using System.Collections;   //使用Arraylist

using System.Linq;  //語言內建查詢

using System.Text;  //編碼方式

using System.Text.RegularExpressions; //正規表達式

using System.Threading;  //多線程

using System.Windows.Forms;  //winform窗體

using System.Windows.Forms.Control;  //winform控件

using System.IO;  //操作檔案、檔案夾

using System.Data;  //操作ado.net

using System.Data.SqlClient; //操作ado.net

using System.Net;  //操作網絡

using System.Net.Sockets;  //操作網絡套接字

using System.Management;  //擷取硬體資訊(需要添加引用)

using System.Drawing;  //繪制系統

using System.Xml;  //操作xml

using System.Media;  //播放wav和系統wav檔案

using Microsoft.Win32;  //操作系統資料庫

using System.Runtime.InteropServices; //引用dll

using System.Security.Cryptography;  //加密解密

using System.Text.RegularExpressions;  //正規表達式

using Microsoft.VisualBasic;  //簡繁體轉換(需要添加引用)

using System.Diagnostics;   //調試輸出

using System.Web.UI;  //web頁面

using System.Web.UI.Control;  //web控件

using System.Configuration; //配置資訊

常用類:

Microsoft.Win32.Registry;  //操作系統資料庫

System.DateTime;  //操作時間

System.Math;  //操作數字類

繼續閱讀