原创 利用WebClient正則表達式下載資源

//我們拿下載圖片舉個例子 static WebClient client = new WebClient(); class Program { static WebClient client = ne

原创 利用StreamReader解析歌詞以及把讀取的歌詞寫到新的txt文件裏

//解析歌詞 class Program { static void Main(string[] args) { //i/o/ inputstream /outstream //

原创 模板鉤子方法的學習

//今天我們學習模板鉤子方法 我們就拿請客吃飯來舉例子,請客吃飯都是 去飯店 點餐 埋單 這幾種方法那麼我們就看看如何去用代碼實現 abstract class Guests { //請客的模板方法

原创 冒泡排序與選擇排序的學習方法

**冒泡排序** 其實和選擇排序一樣很簡單 我拿同一個數組分別用冒泡排序和選擇排序寫一個代碼相信大家就懂了 int[] array = { 3,10,1,5,78 }; //for (int i =

原创 反射的學習與使用

// 反射的用途: //(1)使用Assembly定義和加載程序集,加載在程序集清單中列出模塊,以及從此程序集中查找類型並創建該類型的實例。 //(2)使用Module瞭解包含模塊的程序集以及模塊中的類

原创 //利用 DirectoryInfo遞歸遍歷文件夾,刪除所有文件,文件夾

static void Test01(string path) { DirectoryInfo dir = new DirectoryInfo("d:/aa");//操作目錄,這裏我們首先aa目錄裏面添加

原创 如何利用list和IComparable 結合排序

根據成績對學員進行排序,首先數學成績 如果數學成績相同根據語文成績如果語文成績相同在根據英語成績排序 Student s1 = new Student(“王一”, 87, 76, 65); Student s

原创 初步學習Linq的使用方法表達式

利用ling求數組中>4的數 語句: List arr = new List() { 1, 23, 3, 4, 5, 6 }; IEnumerable<int> result = arr.Where(a => { r

原创 利用遞歸實現折半查找

static void Main(string[] args) { int[] array = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 };