譯序by侯捷
譯序by陳碩
目錄
前言
C#環(huán)境設置
第1章 Hello,C#
1.1 你的第一個C#程序
1.2 命名空間(Namespaces)
1.3 Main()的另一種形式
1.4 編寫一個語句(Statement)
1.5 開啟一個文本文件(Text File)以供讀寫
1.6 格式化輸出
1.7 string型別
1.8 局部對象(Local Objects)
1.9 Value型別和Reference型別
1.10 C# array(數(shù)組)
1.11 new表達式
1.12 垃圾回收(Garbage Collection)
1.13 動態(tài)array:ArrayList collection class
1.14 統(tǒng)一型別系統(tǒng)(The Unified Type System)
1.14.1 暗中裝箱(Shadow Boxing)
1.14.2 拆箱(Unboxing)與向下轉型(Downcast)
1.15 缺口型(Jagged)array
1.16 Hashtable容器
1.17 異常處理(Exception Handling)
1.18 C#語言簡要手冊
1.18.1 關鍵字(Keyworks)
1.18.2 語言內建的數(shù)值型別(Built-in Numeric Types)
1.18.3 算術(Arithmetic)、關系(Relational)和條件(Conditional)操作符
1.18.4 操作符優(yōu)先級(Operator Precedence)
1.18.5 語句(Statements)
第2章 Class的設計
2.1 我們的第一個獨立Class
2.2 開啟一個新的Visual Studio項目
2.3 聲明數(shù)據(jù)成員(Data Members)
2.4 Properties(屬性)
2.5 Indexers(索引器)
2.6 成員初始化(Member Initialization)
2.7 Class的構選函數(shù)(Constructor)
2.8 隱含的(Implicit)this Reference
2.9 static(靜態(tài))成員
2.10 const和readonly數(shù)據(jù)面員
2.11 enum(枚舉)value型別
2.12 deleqate型別
2.13 函數(shù)參數(shù)語義學(Function Parameter Semantics)
2.13.1 傳值(Pass by Value)
2.13.2 傳址(Pass by Reference):ref參數(shù)
2.13.3 傳址(Pass by Reference):out參數(shù)
2.14 函數(shù)得載(Function Overloading)
2.14.1 重載函數(shù)的決議(Resolving)
2.14.2 尋求最佳匹配(Best Match)
2.15 可變長度之參數(shù)列
2.16 操作符重載(Operator Overloading)
2.17 轉換式操作符(Conversion Operators)
2.18 Class的析構函數(shù)(Destructor)
2.19 struct value型別
第3章 面向對象程序設計
3.1 面向對象編程概念
3.2 實現(xiàn)一個“多態(tài)查詢語言”(Polymorphic Query Language)
3.3 設計一個Class繼承體系
3.4 關于object
3.5 設計一個抽象基類(Abstract Base Class)
3.6 聲明一個抽象基類(Abstract Base Class)
3.7 抽象基類(Abstract Base Class)的static成員
3.8 混合型抽象基類(Hybrid Abstract Base Class)
3.8.1 單一繼承下的對象模型(Object Model)
3.8.2 混合型抽象類(Hybrid Abstract Class)有何特別?
3.9 定義一個派生類(Derived Class)
3.10 覆寫繼承而來的虛接口(Virtual Interface)
3.11 覆寫的虛函數(shù)(Virtual Methods)
3.12 成員訪問:new修飾符和base修飾符
3.12.1 可達性(Accessibility)與可見性(Visibility)
3.12.2 將“對基類(Base Class)的訪問”封裝起來
3.13 將Class密封起來
3.14 Exception繼承體系
第4章 接口繼承
4.1 實現(xiàn)System Interface:IComparable
4.2 訪問業(yè)已存在的Interface
4.3 定義一個Interface
4.3.1 實現(xiàn)我們自己的Interface:概念驗證
4.3.2 將我們的Interface整合進入System Framework
4.4 Interface成員的顯式實現(xiàn)(Explicit Implementation)
4.5 繼承得來的Interface成員
4.6 重載?掩蓋?抑或模棱兩可?Overloaded,Hidden,or Ambiguous?
4.7 掌握copy(拷貝)語義:ICloneable
4.8 掌握Finalize(終結)語義:IDisposable
4.9 BitVector以組合(Composition)進行擴充
第5章 控訪System命名空間
5.1 支持基本型別(Fundamental Types)
5.2 所有array都是System.Array
5.3 查詢運行環(huán)境
5.3.1 Environment Class
5.3.2 訪問所有環(huán)境變量(Environment Variable)
5.3.3 Process Class
5.3.4 查找邏輯驅動器
5.4 System.IO
5.4.1 處理文件擴展名:Path Class
5.4.2 操控目錄(Directories)
5.4.3 操控文件(Files)
5.4.4 讀寫文件(Files)
5.5 System雜項討論
5.5.1 System.Collections.Stack容器
5.5.2 System.diagnostics,TraceListener Class
5.5.3 System.Math
5.5.4 DataTime Class
5.6 正則表達式(Regular Expressions)
5.7 System.Threading
5.8 Web的請求/響應模型(Request/Response Model)
5.9 System.Net.sockets
5.9.1 服務器端(Server-Side)的TcpListener
5.9.2 客戶端(Client-Side)的TcpClient
5.10 System.Data
5.10.1 數(shù)據(jù)庫表格(Database Tables)
5.10.2 開啟數(shù)據(jù)庫:選擇一個數(shù)據(jù)供應器(Data Provider)
5.10.3 DataTable巡禮
5.10.4 建立DataRelation
5.10.5 選取動作(Selection)與表達式(Expressions)
5.11 System.Xml
5.11.1 在程序中使用XML
5.11.2 XmlTextReader
5.11.3 Document Object Model(DOM,文檔對象模型)
5.11.4 System.Xml.Xsl
5.11.5 System.Xml.Xpath
第6章 Windows Forms設計器
6.1 我們的第一個Windows Forms程序
6.2 建立GUI
6.3 實現(xiàn)“事件回調例程”(Event Callback Routines)
6.3.1 實現(xiàn)TextBox Event
6.3.2 實現(xiàn)Button Events:OK按鈕
6.3.3 實現(xiàn)Button Events:Quit按鈕
6.4 檢閱并添加Control Events(控件相關事件)
6.4.1 可編程的(Programmable)Labels
6.5 實現(xiàn)MessageBox(彈出式對話框)
6.6 以List Box輸出無格式數(shù)據(jù)
6.7 探究File Dialog(文件對話框)
6.8 程式各樣的Buttons(按鈕)
6.9 端上Menus(菜單)
6.10 DataGrid控件
6.11 添加PictureBox控件
第7章 ASP.NET和Web Forms設計器
7.1 我們的第一個Web Forms程序
7.2 開啟一個ASP.NET Web應用程序項目
7.2.1 修改文檔的Properties(屬性)
7.2.2 在文檔中添加控件:Label
7.3 在項目中加入頁面
7.4 HyperLink控件:鏈接(Linking)其他頁面
7.5 DataGrid控件
7.6 理解頁面事件(Page Event)的生命周期
7.7 數(shù)據(jù)供應器(Data Provider)
7.8 管理Web狀態(tài)
7.8.1 添加TextBox控件
7.8.2 添加ImageButton控件
7.8.3 添加ListBox控件
7.9 狀態(tài)管理:Class Members
7.10 狀態(tài)管理:Session Object
7.11 狀態(tài)管理:Application Object
7.12 起驗證作用的控件(Validation Controls)
7.13 添加DropDownList控件
7.14 添加一組RadioButton控件
7.15 添加CheckBoxList控件
7.16 為控件添加驗證器(Validators)
7.17 添加Calendar控件
7.18 添加Image控件
7.19 編寫Web Server軟件
第8章 通用語言運行層
8.1 裝配件(Assemblies)
8.2 Reflection(運行期型別反射)
8.3 通過BindingFlags個性揀取策略(Retrieval)
8.4 在運行期(runtime)調用某個成員函數(shù)
8.5 將測試委托(Delegating)給Reflection
8.6 Attributes(特征屬性)
8.6.1 固有型Attribute:Conditional
8.6.2 固有型Attribute:Serializable
8.6.3 固有型Attribute:DllImport
8.7 實現(xiàn)我們自己的Attribute class
8.7.1 位置(Positional)參數(shù)與具名(Named)參數(shù)
8.7.2 AttributeUsage
8.8 利用Reflection在運行期獲取Attributes
8.9 中間語言(Intermediate Language)
8.9.1 檢視中間語言
8.9.2 ildasm(IL反匯編)工具
索引