Time of Update: 2016-10-18
標籤:參考代碼1:自己類比出資料,並分別對dataGridView賦值。using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Collections; namespace
Time of Update: 2016-09-27
標籤: C#操作SQL Float類型,資料會多很多小數,原來是C#的float和sql的float類型不一致。以下是資料庫中與C#中的資料類型對照。 /// <summary> /// 資料庫中與C#中的資料類型對照 /// </summary> /// <param name="type"></param> ///
Time of Update: 2016-10-21
標籤:1 path 2 code 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Reflection; 5 using System.Text; 6 using System.Threading.Tasks; 7 8 namespace ConsoleApplication13 9 {10 class Program11
Time of Update: 2016-10-19
標籤:在做一些介面的時候,比如返回資料中有一個時間的屬性,它的值是使用Unix時間戳記表示的,當我們處理它(儲存到本地或者格式化前台展示)時需要轉換成日期時間,在此就需要根據時間戳記轉換為日期時間(註:Unix時間戳記是當前標準時區時間與1970年1月1日所經曆的總秒數)/// <summary>/// 根據時間戳記轉換為目前時間/// </summary>/// <param name="timeSpan">時間戳記(精確到秒)</param>/
Time of Update: 2016-10-20
標籤: 異常處理四要素包括:一個表示異常詳細資料的類類型;一個向調用者引發異常類執行個體的成員;調用者的一段調用異常成員的代碼塊;調用者的一段處理將要發生異常的代碼塊。異常類類型包括:基類:System.Exception;系統級異常:System.SystemException;應用程式級異常:System.ApplicationException。 (一).在.NET中有如下的異常類:
Time of Update: 2016-10-12
標籤:string類型轉成byte[]:byte[] byteArray = System.Text.Encoding.Default.GetBytes ( str ); byte[]轉成string:string str = System.Text.Encoding.Default.GetString ( byteArray ); string類型轉成AS
Time of Update: 2016-10-17
標籤:1 xml檔案 1 <?xml version="1.0" encoding="utf-8" ?> 2 <cultures> 3 4 <daojia count="100"> 5 <book> 6 <name> 道德經</name> 7 <author>老子</author> 8
Time of Update: 2016-10-16
標籤:1 代碼 1 + [0-9]+ 字串中出現一次或者多次數字 2 3 4 using System; 5 using System.Collections.Generic; 6 using System.Linq; 7 using System.Net; 8 using System.Text; 9 using System.Text.RegularExpressions;10 using System.Threading.Tasks;11 12 namespace
Time of Update: 2016-10-12
標籤:簡介定義一個範圍,將在此範圍之外釋放一個或多個對象。文法using (Font font1 = new Font("Arial", 10.0f)){}C# 語言參考主要用途using 關鍵字有兩個主要用途:作為語句用於定義一個範圍,在此範圍的末尾將釋放對象C# 通過 .NET Framework 公用語言運行庫 (CLR) 自動釋放用於儲存不再需要的對象的記憶體。記憶體的釋放具有不確定性;一旦 CLR
Time of Update: 2016-10-16
標籤:Path
Time of Update: 2016-10-15
標籤:轉載自:http://www.cnblogs.com/alana/archive/2012/07/05/2577893.htmlC#的對象記憶體模型:一、棧記憶體和堆記憶體1、棧記憶體 由編譯器自動分配和釋放,主要用來儲存一些局部變數、函數的參數等,例如,int a = 10 ,那麼編譯器會自動在棧上開闢一塊內容用來儲存變數a。2、堆記憶體 由程式員手動申請和釋放,在C++中,通過new關鍵字申請,編譯器不會釋放,必須通過delete釋放,對於C#,通過new
Time of Update: 2016-10-11
標籤:使用迅雷下載壓縮檔到案頭時,下載完畢後,如果直接點擊“開啟檔案”,則迅雷會報錯:C:\WINDOWS\system32\config\systemprofile\Desktop引用了一個停用位置。它可能是一個在本機或網路上的電腦上的硬碟。請檢查以確認此盤正確串連,或者您串連到Internet或您的網路上,然後再試一次。如果仍然不能定位,可能資訊已經被移到其他地方。解決方案:在C盤的user/使用者目錄下,或者左側邊欄的捷徑中,找到desktop/案頭這個捷徑,複製一
Time of Update: 2016-10-15
標籤:1 代碼 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Net; 5 using System.Text; 6 using System.Text.RegularExpressions; 7 using System.Threading.Tasks; 8 9 namespace ConsoleApplication710 {11 class
Time of Update: 2016-10-06
標籤: // WebClient private string GetWebClient(string url) { string strHTML = ""; WebClient myWebClient = new WebClient(); Stream myStream = myWebClient.OpenRead(url); StreamReader sr = new
Time of Update: 2016-10-13
標籤:Regex在程式設計中有著重要的位置,它經常被用於處理字串資訊,下面是正則常用的一些執行個體。//驗證電話號碼public bool IsTelephone(string str_telephone){ return System.Text.RegularExpressions. Regex.IsMatch(str_telephone, @"^(\d{3,4}-)?\d{6,8}$");}//驗證密碼public bool IsPassword(string str_
Time of Update: 2016-10-08
標籤:從位置上講:1、大寫String是.NET Framework裡的String,小寫string是C#語言中的string2、如果刪掉using System;,就不能使用大寫的String,System是.NET
Time of Update: 2016-09-26
標籤:ListView:列表展示資料1、視圖 -2、設定列頭 -3、添加行資料 -資料庫連接:---------------------------------------------------------1、表單載入後自動綁定顯示ListView中的資料 辦法: 資料繫結代碼寫在表單的建構函式中2、給使用者展示最終資料 屬性擴充 3、行號 用C#變數迴圈++來實現 4、資料重複綁定 在綁定之前清空Items集合
Time of Update: 2016-09-28
標籤:C#的調用Delphi的DLL沒有問題,DLL回調時遇到了麻煩,網上找了個方法,解決了這個問題Delphi部分,列舉了三種回呼函數定義 [delphi] view
Time of Update: 2016-09-27
標籤:建立CSA控制項1、建立一個純類,命名空間是:namespace SimPerfect.CSAControlLibrary.CSAControls2、實現兩個建構函式:無參和傳Candy參數 public CDealProcess() { InitMe(); } public CDealProcess(Candy parentCandy) { this.ParentCandy
Time of Update: 2016-10-23
標籤:argv 代碼 div stdio.h hello 作用 語句 print turn 走出迴圈結構的幾種方法:continue,break,goto,return一:continue結束本