Time of Update: 2016-08-19
標籤:1.通過指定串連屬性參數開啟資料庫public IPropertySet ConnectSdeSQL(string sAddress, string sDBName, string sUser, string
Time of Update: 2016-08-20
標籤: #region UpdateLayeredWindow #region 重寫表單的 CreateParams 屬性 protected override CreateParams CreateParams { get { CreateParams cp = base.CreateParams; cp.ExStyle |= 0x00080
Time of Update: 2016-08-20
標籤: 今天正式上手c#的項目,不出所料,綜合性很強,但是能學到很多東西,而且我發現果然有問題上google才是正確的選擇,還好我英語比較好~~~還有42天了,加油啊!!!下面貼出今天的代碼一邊以後複習using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using
Time of Update: 2016-08-19
標籤:1、選擇性參數和命名實參 選擇性參數和命名實參就如同一對好基友,因為它們經常一起使用。 1.1 選擇性參數 選擇性參數重在“可選”,即在調用方法時,該參數可以明確指定實參,也可以不指定。如下代碼所示,下面代碼就包含3個參數,一個必備參數和兩個選擇性參數。 1 static void TestMethod(int x,int
Time of Update: 2016-08-19
標籤: 第一章 深入.NET架構1.1 Microsoft
Time of Update: 2016-08-19
標籤:欄位 屬性 c#對實現者來說像方法對調用者來說像欄位可以將屬性看成一種智能欄位,屬性就是欄位與方法的擴充。物件導向的一個原則就是資料封裝,所以不能將欄位以公有方式提供給外界。650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/86/29/wKiom1e2mKHiLS-CAAALf_iL3ow603.png-wh_500x0-wm_3-wmp_4-s_3089457513.png" title=")P%XYWW4(4HDX49(
Time of Update: 2016-08-19
標籤:讀取excel用到的方法: /// <summary> /// Excel匯入資料來源 /// </summary> /// <param name="sheet">sheet</param> /// <param name="filename">檔案路徑</param> /// <returns></returns>
Time of Update: 2016-08-19
標籤:使用unsafe代碼 Unsafe, fixed, stackalloc 由於C#可以使用中繼資料,驗證函式簽名、物件類型,保證執行過程的安全,如果要使用指標,則不能進行驗證,用unsafe表示。unsafe可以指定類、方法和程式碼片段,可以在unsafe的上下文使用指標,指標只能指向簡單的“非託管”實值型別,不能指向對象,class等。
Time of Update: 2016-08-19
標籤:我前兩天看見同事用寫了用AOP技術實現緩衝的方案,於是好奇看了一下這是怎麼實現的。原來是用了.NET中的一個類ContextBoundObject和Attribute相關技術。其實個類在.NET
Time of Update: 2016-08-19
標籤: 1 using System; 2 using System.IO; 3 4 namespace _24._6_讀取磁碟機資訊 5 { 6 class Program 7 { 8 static void Main(string[] args) 9 {10 var di = DriveInfo.GetDrives();11 12 foreach (var d in di)13
Time of Update: 2016-08-19
標籤:C# 參考之方法參數關鍵字:params、ref及out如果在為方法聲明參數時未使用 ref 或
Time of Update: 2016-08-19
標籤:C#支援的運算子https://msdn.microsoft.com/zh-cn/library/6a71f45d(v=vs.140).aspxchecked 和 uncheckedbyte b = 255;b++;Console.WriteLine(b);byte資料類型 範圍 0~255。遞增 b 的值會導致溢出。CLR如何處理這個溢出取決於很多因素,包括編譯器選項。可以使用代碼塊標記 checked,發生溢出,拋出 OverflowException 異常。byte b =
Time of Update: 2016-08-19
標籤:1、c#根據絕對路徑擷取 帶尾碼檔案名稱、尾碼名、檔案名稱。 string str =" E:\test\Default.aspx";
Time of Update: 2016-08-19
標籤:最近參加項目中,資料操作基本都是用DataTable的操作,老代碼中有些地方用到DataTable.Rows.Add又有些代碼用的DataTable.ImportRow,於是就對比了一下VS查詢說明:顯示//// 摘要: // 建立使用指定值的行,並將其添加到 System.Data.DataRowCollection 中。//// 參數: // values:// 用於建立新行的值的數組。//// 返回結果: // 無。//// 異常: //
Time of Update: 2016-08-19
標籤:最近對QQ聊天機器人比較感興趣,奈何一直沒找到C#的源碼,就自己摸索,好了廢話不多說了,開始正題。首先我們要準備的是C# 的SDK:https://cqp.cc/t-24088-1-1,Newtonsoft.Json.dll外掛程式開啟C#SDK源碼後找到MyApp.cs(QQ發送消模組) 在裡面找到QQ私聊訊息 HttpWebResponse Response = null; string result = null; String
Time of Update: 2016-08-19
標籤:轉載原地址 http://www.cnblogs.com/gjahead/archive/2008/02/28/1084871.htmlref和out的區別在C# 中,既可以通過值也可以通過引用傳遞參數。通過引用傳遞參數允許函數成員更改參數的值,並保持該更改。若要通過引用傳遞參數,
Time of Update: 2016-08-19
標籤:大多數集合都在System.Collections,System.Collections.Generic兩個命名空間。其中System.Collections.Generic專門用於泛型集合。針對特定類型的集合類型位於System.Collections.Specialized;命名空間;安全執行緒的集合類位於System.Collections.Concurrent;命名空間。下面是集合和列表實現的介面如下: 一、列表 [Serializable]
Time of Update: 2016-08-18
標籤: 1、比較字串 String 類提供了一系列的方法用於字串的比較,如CompareTo 和 Equals方法等。 ① CompareTo : 如果參數的值與此執行個體相等,則返回0;如果此執行個體大於參數的值,則返回1;否則返回-1。 string str1 = "abc"; int m1 = str1.CompareTo("abc"); // m1 = 0 int m2 = str1.CompareTo("ab"); //m2 = 1
Time of Update: 2016-08-18
標籤:using System; using System.Collections; using System.Configuration; using System.Data; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using
Time of Update: 2016-08-18
標籤:看代碼實現: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 7 namespace Test 8 { 9 class Program10 {11 static void Main(string[] args)12 {13