Time of Update: 2017-01-13
C++讀寫檔案作業碼常量 值 說明 fmOpenRead 0 以唯讀屬性開啟 fmOpenWrite 1 以唯寫屬性開啟 fmOpenReadWrite 2 以讀/寫屬性開啟 fmShareCompat 0 相容FCB方式(彙編中有相應的DOS功能調用,感興趣自已查閱相關資料) fmShareExclusive 16 共用方式:以獨佔方式開啟,在關閉以前,別人不能訪問 fmShareDenyWrite 32 共用方式:拒絕寫訪問 fmShareDenyRead 48
Time of Update: 2017-01-13
幾個關鍵技術點:1、C#要以非託管方式調用DLL;2、C#把整理好的畫圖資料產生事先定義好格式的XML檔案,傳給DLL;3、DLL解析XML檔案,根據相應格式,要求,畫圖;4、DLL輸出GIF檔案(經過比較GIF映像失真率小,且檔案大小最小);5、C#裝載GIF檔案,傳到前台展示。 library Icdll;uses SysUtils; function Check22:Pchar;stdcall; begin&
Time of Update: 2017-01-13
遞迴的優點是直觀、易懂:寫起來如此,讀起來也是這樣。但是每次遞迴都是call stack的不斷疊加,對於這個問題,其需要消耗o(n)的棧空間,棧空間,棧空間~~~於是,我們也可以將其轉化成迴圈的方式來實現void printallsubsets2(int* a, int n){ // initialize flags as false bool* b = new bool[n]; for(int i = 0; i < n; i++) { &
Time of Update: 2017-01-13
c#中new, override, virtual的具體用法 class program { static void main(string[] args)
Time of Update: 2017-01-13
有一個textbox1和textbox2 和一個button要求textbox1輸入毫秒數以後。按button textbox2顯示時間比如textbox1輸入1248671343262 按button以後textbox2顯示類似mon jul 27 13:09:03 cst 2009這樣的時間你所說的毫秒數1248671343262是將datetime對象通過方法tofiletimeutc或tofiletime轉換成的windows檔案時間(一個 64
Time of Update: 2017-01-13
代碼如下複製代碼 /// <summary>/// Regex 抓取需要的內容/// </summary>/// <param name="HtmlCode">HTML代碼</param>/// <param name="RegexString">Regex</param>/// <param
Time of Update: 2017-01-13
今天無意中看到有關Invoke和BeginInvoke的一些資料,不太清楚它們之間的區別。所以花了點時間研究了下。 據msdn中介紹,它們最大的區別就是BeginInvoke屬於非同步執行的。Control.Invoke 方法 (Delegate) :在擁有此控制項的基礎視窗控制代碼的線程上執行指定的委託。 Control.BeginInvoke 方法 (Delegate) :在建立控制項的基礎控制代碼所線上程上非同步執行指定委託。 msdn說明:
Time of Update: 2017-01-13
代碼如下複製代碼 DateTime dt = DateTime.Now;Label1.Text = dt.ToString();//2009-07-5 13:21:25Label2.Text = dt.ToFileTime().ToString();//127756416859912816Label3.Text = dt.ToFileTimeUtc().ToString();//127756704859912816Label4.Text =
Time of Update: 2017-01-13
下面貼代碼: 代碼如下複製代碼 using System; using System.Collections.Generic; using System.Text; namespace ClassObjectAndStringDiffDemo { class Program
Time of Update: 2017-01-13
下列是整數型別的記憶體位元組數:int 4位元組記憶體使用量 -2147483648~2147483647uint 不帶負號的整數 0-4294967295short 2位元組 -32768~32767ushort 2位元組 0-65535long 8位元組 -9223372036854775808~9223372036854775807ulong
Time of Update: 2017-01-13
代碼如下複製代碼 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; namespace 檔案操作 { class Program { static void Main(string[] args) { //建立一個文字檔,最好先判斷一下 StreamWriter sw; if
Time of Update: 2017-01-13
我們先來看個效果圖當你只定義一個str而不為其分配記憶體時用string str=null,但是在接下來你使用它之前必須為它賦值如str=“xxxx”也就是為它初始化而string str= string.Empty是定義和初始化放在了一起它實際是等價於string str=null;str="";具體使用時,如果你確定在使用前會給str賦值就用string str=null,否則用string str=
Time of Update: 2017-01-13
代碼如下複製代碼 using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Collections;public partial class _Default : System.Web.UI.Page {
Time of Update: 2017-01-13
有時候我們希望把類的執行個體儲存下來,以便以後的時候用。一個直觀的方法就是StreamWriter把類寫成一行,用t分隔開每個屬性,然後用StreamReader讀出來。但是這樣太麻煩,程式碼數較多,而且必須事Crowdsourced Security Testing道屬性在行中的對應位置。這時候如果採用類序列化的方式儲存就使得代碼很簡單:假如你有一個類,在它的上面加上[Serializable]屬性就可以了,表示這個類是可以序列化的[Serializable]
Time of Update: 2017-01-13
readonly 允許把一個欄位設定成常量,但可以執行一些運算,可以確定它的初始值。因為 readonly 是在計算時執行的,當然它可以用某些變數初始化。readonly 是執行個體成員,所以不同的執行個體可以有不同的常量值,這使readonly更靈活。readonly 關鍵字與 const 關鍵字不同。1. const 欄位只能在該欄位的聲明中初始化。 readonly 欄位可以在聲明或建構函式中初始化。因此,根據所使用的建構函式,readonly
Time of Update: 2017-01-13
nl whois.domain-registry.nleu whois.euedu whois.educause.netnet whois.crsnic.netcom whois.crsnic.netorg whois.crsnic.netinfo whois.afilias.comde whois.denic.decn whois.cnnic.net.cn這些是我收集的whois伺服器比如你要查詢的網域名稱 是www.111cn.net 它是屬於 .net尾碼的,這個時候你就要去 whois.
Time of Update: 2017-01-13
下面這段代碼可以對C#中對檔案的建立 移動 刪除 複製操作等有需要的朋友可以參考一下。/// <summary> /// 判斷檔案或檔案夾是否存在 /// </summary> /// <param
Time of Update: 2017-01-13
C# 串連SQL 連接字串 //sql server 身分識別驗證 連接字串private string ConnstrSqlServer = "server=伺服器名稱;uid=登入名稱稱;pwd=登入密碼;database=資料庫教程名稱";//windows 身分識別驗證連接字串private string ConnstrWindows = "server=伺服器名稱;database=資料庫名稱;Trusted_Connection=SSPI";/
Time of Update: 2017-01-13
C# ComboBox自動完成功能的樣本DataTable dt = new DataTable(); dt.Columns.Add("Name"); dt.Columns.Add("VV"); dt.Rows.Add(new string[] { "王一", "x" }); dt.Rows.Add(new string[] { "趙一", "z" });
Time of Update: 2017-01-13
報錯資訊如下Error: ossl_pkey_ec.c:In functin 'ossl_ec_group_initialize': ossl_pkey_ec.c:816:error: 'EC_GROUP_new_curve_GF2m' undeclard (first use in this function) ossl_pkey_ec.c:816:error: (Each undeclard indentifier is reported only once ossl_pkey_ec.c:8