Time of Update: 2018-12-03
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 泛型{ class 泛型介面 { public static void Main() { PersonManager man = new PersonManager(); Person per = new Person();
Time of Update: 2018-12-03
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace CSharp基礎{ class 對象比較 { public static void Main() { object obj1 = new object(); object obj2 = new object();
Time of Update: 2018-12-03
using System;using System.Collections.Generic;using System.Text;using System.Text.RegularExpressions;namespace 字串{ class Regex { public static void Main() { //Regex是用來簡化字串操作的,一般正則所實現的功能,用方法也一樣可以,只是方法有可能就會變的很複雜!
Time of Update: 2018-12-03
圖1 圖2 我們在面象對象設計中,要遵循依賴倒置原則,也就是說,抽象不依賴於實現細節,而實現細節要依賴於抽象 ,
Time of Update: 2018-12-03
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.CodeDom.Compiler ;using Microsoft.CSharp ;using System.Reflection ;using System.IO ;namespace WpfApplication2{ class CodeDriver { private
Time of Update: 2018-12-03
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Collections;namespace CSharp基礎{ class 迭代器 { public static void Main() { MyArrayList arr = new MyArrayList(); fore
Time of Update: 2018-12-03
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Collections;namespace 泛型{ //簡單鏈表的實現,單向(泛型) class 泛型類 { public static void Main() { LinkedList<string>
Time of Update: 2018-12-03
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 泛型{ // 泛型特性:1預設值
Time of Update: 2018-12-03
調用處代碼 private void button1_Click(object sender, EventArgs e) { string urlStr = this.textUrl.Text ; if (urlStr == null || "".Equals(urlStr)) { MessageBox.Show( "必須填寫要防問的地址!");
Time of Update: 2018-12-03
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 泛型{ //泛型特性3 繼承 // 泛型類可以執行泛型介面,也可以派生於一個類
Time of Update: 2018-12-03
C#你真的入門了嗎? 孟言:大家下午好,又是我給大家主持這一期的訪談節目,今天我邀請到大名鼎鼎的韓磊,他一方面是CSDN的運營者,另一方面是著名的技術專家,前不久他翻譯了一本書,叫《Beginning C# Objects》,當時我知道的時候很詫異,我不知道為什麼他在這樣一個位置上還去作這樣一個事情,後來他跟我講了,他認為這本書很有意義,對於C#對於編程很有意義的一本書,今天請他來給我們介紹一下為什麼要翻譯這本書,有何意義?
Time of Update: 2018-12-03
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace CSharp基礎{ class 類型轉換 { public static void Main() { //byte b1 = 22; //byte b2 = 33;
Time of Update: 2018-12-03
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 泛型{ class 泛型的特性 { public static void Main() { //泛型類的特性4 靜態成員
Time of Update: 2018-12-03
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 集合{ class 棧 { public static void Main() { //棧與隊列是一個非常類似的容器 //區別在於:隊列是FIFO先進先出,而棧是LIFO後進先出
Time of Update: 2018-12-03
I tried hard to use the first method of 密碼輸入關閉回顯的兩種方法 , which is named ncurses, the user interaction is very bad. the second method is better and works fine.A piece of code is ready to use:#include <stdio.h>#include <termios.h>#include &
Time of Update: 2018-12-03
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace LINQ技術{ class Program { static void Main(string[] args) { //LINQ中的Where擴充方法,要想使用,必須匯入using System.Linq;
Time of Update: 2018-12-03
public string GetChineseSpell(string strText) { int len = strText.Length; string myStr = ""; for(int i=0;i<len;i++) { myStr += getSpell(strText.Substring(i,1)); } return myStr; } public string getSpell(string cnChar) { byte[] arrCN =
Time of Update: 2018-12-03
線程:線程是進程的獨立執行單元,每一個進程都有一個主線程,除了主線程可以包含其他的線程。多線程的意義:多線程有助於改善程式的總體響應性,提高CPU的效率。 多線程的應用程式定義域是相當不穩定的,因為多個線程在同一時間內都能運行共用的功能模組。為了保護應用程式的資源不被破壞,為多線程程式提供了三種加鎖的機制,分別是:Monitor類、Lock關鍵字和Mutex類。 1. lock
Time of Update: 2018-12-03
1.安裝好任意能編譯調試.net工程的工具,推薦兩個免費的a.SharpDevelop2, http://www.icsharpcode.net/OpenSource/SD/Download/b.Visual Studio Express Editions, http://msdn.microsoft.com/vstudio/express/support/install/ 2.保證.net1.1和.net2.0的runtime都安裝了a.net1.1 runtime
Time of Update: 2018-12-03
C語言內建函式的一點疑問如果一個函數只能被本檔案中其他函數所調用,他稱為內建函式。在定義內建函式時,在函數名和函數類型的前面加static,即: static 類型標誌符 函數名 (形參表);內建函式又稱為靜態函數。在定義函數時,如果在函數首部的最左端加關鍵字extern ,則表示此函數是外部函數,可供其他檔案調用。往往extern是預設的。 如果我在同一個cpp檔案中定義了一個靜態函數,現在我想在main函數裡面調用它。且靜態函數的位置在main函數的下面。問如何聲明???如: