建構函式與解構函式:using System;class MyClass{ private int FNum; public int Num { get { return FNum; } } /* 建構函式沒有傳回值, 無參的建構函式是預設的 */ public MyClass() { this.FNum = 2009; } /* 可以有多個參數不同的建構函式 */ public MyClass(int x) {
using System;using System.Configuration;using System.Data;using System.Data.SqlClient;using System.Collections;namespace DBUtility{ /// <summary> /// The SqlHelper class is intended to encapsulate high performance, /// scalable best
代碼風格檢查:StyleCop代碼缺陷檢查:FxCop代碼品質: 程式碼度量值/Code MetricsStyleCop介紹The StyleCop tool provides warnings that indicate style and consistency rule violations in C# code. The warnings are organized into rule areas such as documentation, layout, naming,
基礎Brian W. Kernighan, Dennis M. Ritchie,《C程式設計語言(影印版)》 Brian W.Kernighan, Dennis M.Ritchie,《C程式設計語言》 K&RSamuel P. Harbison, Guy L. Steele,《C語言參考手冊(第五版)》Kenneth A.Reek C和指標進階和實戰Andrew Koenig的著作《C陷阱和缺陷》Deitel父子合著的《C How to Program》Perter Van Der
前言:從上周開始看<<CLR via C#>>第三版,剛剛看完了第四和第七兩章,這兩章都算常識,但是有很多基礎知識和術語理解不是很深入,所以看得有點慢,計劃每兩周寫點心得,是以成文。1、應用情境重現一個簡單的應用程式解決方案,如下:其中,類庫CSharpLib裡定義一個簡單的類SomeType如下:namespace CSharpLib{ public class SomeType { public const int ConstField =
c#和.net基類為開發多線程應用程式提供了強大的支援。下面是我看書和結合網上的一些資源整理出來的筆記。因為線程相關的知識比較繁雜和高深(並且本人開發經驗欠缺),所以寫的很淺顯甚至幼稚,理解不妥之處在所難免。1.怎樣建立一個線程(常用的建立方式)CodeCode highlighting produced by Actipro CodeHighlighter