Time of Update: 2018-12-07
若要在後台執行耗時的操作,請建立一個 BackgroundWorker,偵聽那些報告操作進度並在操作完成時發出訊號的事件。 這裡使用《C#進階編程》裡面的一個例子說明這個類的使用:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using
Time of Update: 2018-12-07
首先看下一個一般的,非泛型的簡化鏈表類。using System;using System.Collections;using System.Linq;using System.Text;// 不要使用System.Collections.Generic命名空間// 使用System.Collections命名空間// 否則當繼承 IEnumerable類的時候,會有錯誤發生/*-----------------------------------------------------------
Time of Update: 2018-12-07
The C and C++ languages have long used the concept of function pointer. This was even more useful when programming for the Microsoft Windows operating systems because the Win32 library relies on the concept of callback functions. Callback functions
Time of Update: 2018-12-07
文章目錄 ParametersReturn ValueRemarks MSDN上的一個不錯的例子: 那從記憶體清除密碼的句子有個問題。 需要再看看這個問題到底是怎麼回事,怎麼解決cannot convert from Sytem.InPtr to ref string把下面這句public static extern bool ZeroMemory(ref string Destination, int Length);用這句替換就OK了
Time of Update: 2018-12-07
選擇一個表中指定列:use XSCJselect 姓名, 專業名, 總學分from XSwhere 專業名 = '電腦'返回所有列:select * from XS修改查詢結果中的欄位標題:select 學號 as number, 姓名 as name, 總學分 as markfrom XSwhere 專業名 = '電腦'替換查詢結果中的資料:select 學號, 姓名 等級 = /*修改返回結果的顯示列名*/ case when 總學分 is null then
Time of Update: 2018-12-07
使用delete語句刪除資料的一般文法格式:delete [from]{table_name、view_name}[where<search_condition>]將XS表中的所有行資料刪除delete XS 執行完後,發現XS表中的資料都刪除了,但是表的結構什麼都還在。 truncatetruncate table語句將刪除指定表中所有資料,因此也稱其為清除表資料語句,一般格式如下truncate table
Time of Update: 2018-12-07
計算複利的數學公式:年收益是x%,那N年以後的收益是(1+x%)^N。 用excel可以自動計算,公式是:=power(1.08,n),1.08是1+年增長,n是年數。 簡單的估算方式:72法則-用來計算在給定年收益的情況下,約需要多少年投資才會翻倍。 舉例說明:比如年收益是5%,那用72/5=14.4。也就是約14.4年可以將投資翻番(如果用標準公式計算結果為14.2年);如果年收益為7%,用72/7=10.3,也就是約10.3年投資可以翻一番(用公式計算為10.24年);如果年收益為10%,
Time of Update: 2018-12-07
Virtual Machine Additions 的作用: 1.支援在虛擬機器和宿主機之間拖放來複製檔案; 2.允許虛擬機器通過檔案分享權限設定來訪問宿主機上的檔案; 3.支援指標整合,允許在虛擬機器視窗和宿主機之間自由切換滑鼠; 4.支援在DOS作業系統中使用CD-ROM磁碟機; 5.最佳化顯示適配器驅動; 6.虛擬機器和宿主機之間的時間同步; 7.剪貼簿共用; 8.提高客戶作業系統效能; 9.支援動態調整虛擬機器顯示視窗; Virtual Machine Additions 的安裝步驟:
Time of Update: 2018-12-07
public static string CopyDirectory(string source, string destination, bool IsBaseFolder) { try { DirectoryInfo sourceInfo = new DirectoryInfo(source); DirectoryInfo destinationInfo = new
Time of Update: 2018-12-07
參考了許多的資料和不斷地調試,總算把這個問題弄清楚了。實現了一個簡單的分頁樣本,雖然這樣的做法不是太好。 程式有3個控制項BindingNavigator: 就是DataGridView控制項上面的那個,在工程裡名字: bindngrDemoDataGridView: dgvDemoBindingSource: 這個其實可以不要 bindseDemo 樣本採用的是SQL SERVER的樣本資料庫pub在pub資料庫裡寫入分頁預存程序CREATE PROCEDURE
Time of Update: 2018-12-07
In the above examples, we had to create a method that would be associated with a delegate. You can create a delegate, then, when you need to use, create a type of local implementation of a method and use it. In other words, you do not have to
Time of Update: 2018-12-07
GROUP BY用於對錶或者視圖的資料按欄位分組:例如:求各專業的學生人數:USE StudentsSELECT 專業名, COUNT(*) AS '學生數'FROM XSGROUP BY 專業名 產生一個結果集,包括每個專業的男生人數,女生人數,總人數及學生總人數USE StudentsSELECT 專業名, 性別, COUNT(*) AS '人數'FROM XSGROUP BY 專業名,性別WITH ROLLUP 電腦 0 3電腦 1 8電腦 NULL 1
Time of Update: 2018-12-07
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000.
Time of Update: 2018-12-07
質數又稱素數。指在一個大於1的自然數中,除了1和此整數自身外,沒法被其他自然數整除的數。換句話說,只有兩個正因數(1和自己)的自然數即為素數。比1大但不是素數的數稱為合數。1和0既非素數也非合數。素數在數論中有著很重要的地位。 基本特點 最小的素數是2, 他也是唯一的偶素數。 最前面的素數依次排列為:2,3,5,7,11,13,17,...... 不是質數且大於1的正整數稱為合數。 質數表上的質數請見素數表。 依據定義得公式:
Time of Update: 2018-12-07
DataTable.AcceptChanges 方法 提交自上次調用 AcceptChanges 以來對該表進行的所有更改。 如果不允許該命令DataTable的資料修改是無效的。舉個簡單的樣本private void button1_Click(object sender, EventArgs e) { string conn = "Data Source=(local);Initial Catalog=Test;Integrated Security
Time of Update: 2018-12-07
參考http://www.cnblogs.com/chengulv/archive/2008/11/11/1292145.html(一) 有沒有人遇到這種情況,用 SqlDataAdapter.Update(ds)更新時出錯?answer: 一般是這樣的,如果用設計器將SqlDataAdapter拖到頁面中使用時,不會出現這種情況,因為系統會自動產生SqlDataAdapter的屬性命令,比如: .UpdateCommane insertCommand
Time of Update: 2018-12-07
DataGridView控制項的DataSource有以下幾個類型:DataGridView 類支援標準的 Windows 表單資料繫結模型。這意味著資料來源可以是實現下列介面之一的任何類型: IList 介面,包括一維數組。 IListSource 介面,例如,DataTable 和 DataSet 類。 IBindingList 介面,例如,BindingList 類。 IBindingListView 介面,例如,BindingSource
Time of Update: 2018-12-07
事件是一種允許類發送訊號的方式,用來表明某個重要事情的發生。using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace Event{ class Program { static void Main(string[] args) { LongTask It = new LongTask();
Time of Update: 2018-12-07
看了這一系列的爭吵,對於一個初學者來說,是挺困惑的。要不要學C#呢?到底要掌握什麼樣的語言呢?沒有絕對好的,只有適合自己的才是最好的。每個語言都有它自己的優劣點,這個毋容置疑。其實firelong也沒有直接全盤否定C#的意思,主要只是在強調微軟在.net上做了很多不太實用的特性,導致.net平台越來越大,越來越難以推廣。要知道中國這樣的網路下一個100多M的平台是件不容易的事情。當然微軟後面很聰明了,作業系統內建。這個是一個不錯的舉措。我是一個C#的fans,還是很喜歡這個程式設計語言的。準確說
Time of Update: 2018-12-07
關閉“系統還原”的步驟單擊“開始”,按右鍵“我的電腦”,然後單擊“屬性”。 在“系統屬性”對話方塊中,單擊“系統還原”選項卡。 單擊以選中“關閉系統還原”或“在所有磁碟機上關閉系統還原”複選框。 單擊“確定”。 當您收到以下訊息時,請單擊“是”確認要關閉“系統還原”:您已選擇關閉系統還原。如果您這樣做,所有現有的還原點都將被刪除,並且您不能跟蹤或撤銷您的電腦的改動。您想要關閉系統還原嗎?稍後,“系統屬性”對話方塊將關閉。開啟“系統還原”的步驟單擊“開始”,按右鍵“我的電腦”,然後單擊“屬性”。