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
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函數的下面。問如何聲明???如:
Time of Update: 2018-12-03
最近一直在想這個問題,我們能用c語言實現c++的核心的幾個功能嗎?包括類和介面。初步的想法是用c語言編譯器結合自己寫的cxx2c翻譯程式實現編譯cxx程式的目的.將原來用cxx寫的代碼經過cxx2c的翻譯程式,將cxx代碼中的所有cxx專屬的文法翻譯成c所能識別的文法規則產生
Time of Update: 2018-12-03
int main(int argc,char *argv[])argc(argument count):參數的個數;argv(argument value):參數值argv[0] :檔案名稱argv[1]:第一個參數,argv[2];第二個參數,以此類推。編譯C1 單來源程式到可執行程式 編譯 串連源檔案(.c)--------->目標檔案(.o)------->可執行檔 hello.c -c howdy ./
Time of Update: 2018-12-03
編譯選項---------IDE掩蓋下的天空/*************************************** * gcc for c language ***************************************/Single Source to Executable$ gcc helloworld.c [-o howdy]預設產生的名字a.exe______________________________________Source File to
Time of Update: 2018-12-03
Single Source File to Executable$ g++ helloworld.cpp [-o helloworld]用gcc編譯c++:$ gcc helloworld.cpp -lstdc++ -o helloworld_____________________________________________Multiple Source Files to Executable$ g++ hellospeak.cpp speak.cpp -o hellospeak_____
Time of Update: 2018-12-03
想寫點《C++
Time of Update: 2018-12-03
void func1( MYCLASS *&pBuildingElement ; 論壇中經常有人問到這樣的問題。本文試圖通過一些實際的指標使用經驗來解釋這個問題。仔細看一下這種聲明方式,確實有點讓人迷惑。在某種意義上,"*"和"&"是意思相對的兩個東西,把它們放在一起有什麼意義呢?。為了理解指標的這種做法,我們先複習一下C/C++編程中無所不在的指標概念。我們都知道MYCLASS*的意思:指向某個對象的指標,此對象的類型為MYCLASS。 Void func1(MYCLASS
Time of Update: 2018-12-03
轉自http://hi.baidu.com/kuliuheng/item/438ad2f83b3ef7693c1485f5一、C++中不能使用random()函數==================================================================================本文由青松原創並依GPL-V2及其後續版本發放,轉載請註明出處且應包含本行聲明。C++中常用rand()函數產生隨機數,但嚴格意義上來講產生的只是偽隨機數(pseudo-ra
Time of Update: 2018-12-03
result love(boy, girl) { if ( boy.有房() and boy.有車() ) { boy.set(nothing); return girl.嫁給(boy); } else if ( girl.願意等() ) { while( ! (boy.賺錢 > 100,000 and girl.感情 > 8 ) ) { for ( day=1; day <=365; day++)
Time of Update: 2018-12-03
[轉載] MSDN:ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.2052/cpguide/html/cpcondiscoveringtypeinformationatruntime.htm提綱:1、 什麼是反射2、 命名空間與裝配件的關係3、 運行期得到類型資訊有什麼用4、 如何使用反射擷取類型5、 如何根據類型來動態建立對象6、 如何擷取方法以及動態調用方法7、 動態建立委託 1、什麼是反射 Reflection,中文翻譯為反射。 這是.
Time of Update: 2018-12-03
便於對文章的開展,需要先明確兩個概念。第一個就是很多人用.Net寫程式,會談到託管這個概念。那麼.Net所指的資源託管到底是什麼意思,是相對於所有資源,還是只限於某一方面資源?很多人對此不是很瞭解,其實.Net所指的託管只是針對記憶體這一個方面,並不是對於所有的資源;因此對於Stream,資料庫的串連,GDI+的相關對象,還有Com對象等等,這些資源並不是受到.Net管理而統稱為非託管資源。而對於記憶體的釋放和回收,系統提供了GC-Garbage