C#高级编程(第6版)

获得积分
资料库会员登录
搜索: [高级搜索]
下载首页 | 资源分类 | 下载排行
您的位置: 首页 > 程序语言 > .NET
 
分类导航
下载排行
最新资源
C#高级编程(第6版)
资源大小:5.42 MB 资源类型:文档
下载积分: 0
更多
-->
下载统计:总下载:0,本月下载:0,本周下载:0,今日下载:0
发表评论 错误报告 加入收藏夹
资源介绍
第1 章.NET 体系结构..................................................................................................................................7
1.1 C#与.NET 的关系............................................................................................................................. 7
1.2 公共语言运行库................................................................................................................................7
1.2.1 平台无关性.............................................................................................................................8
1.2.2 提高性能.................................................................................................................................8
1.2.3 语言的互操作性.....................................................................................................................8
1.3 中间语言............................................................................................................................................9
1.3.1 面向对象和接口的支持.......................................................................................................10
1.3.2 相异值类型和引用类型.......................................................................................................10
1.3.3 强数据类型...........................................................................................................................11
1.3.4 通过异常处理错误...............................................................................................................15
1.3.5 特性的使用...........................................................................................................................15
1.4 程序集..............................................................................................................................................16
1.4.1 私有程序集...........................................................................................................................16
1.4.2 共享程序集...........................................................................................................................16
1.4.3 反射.......................................................................................................................................17
1.5 .NET Framework 类.........................................................................................................................17
1.6 命名空间..........................................................................................................................................18
1.7 用C#创建.NET 应用程序.............................................................................................................. 18
1.7.1 创建ASP.NET 应用程序.....................................................................................................18
1.7.2 创建Windows 窗体............................................................................................................. 19
1.7.3 使用Windows Presentation Foundation(WPF)....................................................................20
1.7.4 Windows 控件...................................................................................................................... 20
1.7.5 Windows 服务...................................................................................................................... 20
1.7.6 Windows Communication Foundation(WCF)...................................................................... 20
1.8 C#在.NET 企业体系结构中的作用............................................................................................... 20
1.9 小结..................................................................................................................................................21
第2 章C# 基础........................................................................................................................................... 23
2.1 引言..................................................................................................................................................23
2.2 第一个C#程序................................................................................................................................ 23
2.2.1 代码.......................................................................................................................................23
2.2.2 编译并运行程序...................................................................................................................24
2.2.3 详细介绍...............................................................................................................................24
2.3 变量..................................................................................................................................................26
2.3.1 变量的初始化.......................................................................................................................26
2.3.2 类型推断...............................................................................................................................27
2.3.3 变量的作用域.......................................................................................................................28
2.3.4 常量.......................................................................................................................................30
2.4 预定义数据类型..............................................................................................................................31
2.4.1 值类型和引用类型...............................................................................................................31
2.4.2 CTS 类型.............................................................................................................................. 32
2.4.3 预定义的值类型...................................................................................................................32
2.4.4 预定义的引用类型...............................................................................................................34
2.5 流控制..............................................................................................................................................36
2.5.1 条件语句...............................................................................................................................36
2.5.2 循环.......................................................................................................................................39
2.5.3 跳转语句...............................................................................................................................42
2.6 枚举..................................................................................................................................................43
2.7 数组..................................................................................................................................................45
2.8 命名空间..........................................................................................................................................45
2.8.1 using 语句............................................................................................................................. 46
2.8.2 命名空间的别名...................................................................................................................47
2.9 Main()方法.......................................................................................................................................48
2.9.1 多个Main()方法...................................................................................................................48
2.9.2 给Main()方法传送参数.......................................................................................................49
2.10 有关编译C#文件的更多内容...................................................................................................... 49
2.11 控制台I/O..................................................................................................................................... 51
2.12 使用注释........................................................................................................................................52
2.12.1 源文件中的内部注释.........................................................................................................52
2.12.2 XML 文档说明...................................................................................................................53
2.13 C#预处理器指令........................................................................................................................... 54
2.13.1 #define 和#undef...............................................................................................................55
2.13.2 #if, #elif, #else 和#endif......................................................................................................55
2.13.3 #warning 和# error............................................................................................................ 56
2.13.4 #region 和#endregion..........................................................................................................56
2.13.5 #line.....................................................................................................................................56
2.13.6 #pragma...............................................................................................................................57
2.14 C#编程规则................................................................................................................................... 57
2.14.1 用于标识符的规则.............................................................................................................57
2.14.2 用法约定.............................................................................................................................58
2.15 小结................................................................................................................................................62
第3 章对象和类型......................................................................................................................................63
3.1 类和结构..........................................................................................................................................63
3.2 类成员..............................................................................................................................................64
3.2.1 数据成员...............................................................................................................................64
3.2.2 函数成员...............................................................................................................................65
3.2.3 只读字段...............................................................................................................................76
3.3 匿名类型..........................................................................................................................................77
3.4 结构..................................................................................................................................................77
3.4.1 结构是值类型.......................................................................................................................79
3.4.2 结构和继承...........................................................................................................................79
3.4.3 结构的构造函数...................................................................................................................79
3.5 部分类..............................................................................................................................................80
3.6 静态类..............................................................................................................................................80
3.7 Object 类.......................................................................................................................................... 81
3.7.1 System.Object 方法.............................................................................................................. 81
3.7.2 ToString()方法......................................................................................................................82
3.8 扩展方法..........................................................................................................................................83
3.9 小结..................................................................................................................................................84
第4 章继承.............................................................................................................................................84
4.1 继承的类型......................................................................................................................................84
4.1.1 实现继承和接口继承...........................................................................................................84
4.1.2 多重继承...............................................................................................................................85
4.1.3 结构和类...............................................................................................................................85
4.2 实现继承..........................................................................................................................................85
4.2.1 虚方法...................................................................................................................................86
4.2.2 隐藏方法...............................................................................................................................87
4.2.3 调用函数的基类版本...........................................................................................................88
4.2.4 抽象类和抽象函数...............................................................................................................88
4.2.5 密封类和密封方法...............................................................................................................89
4.2.6 派生类的构造函数...............................................................................................................89
4.3 修饰符..............................................................................................................................................93
4.3.1 可见性修饰符.......................................................................................................................93
4.3.2 其他修饰符...........................................................................................................................94
4.4 接口..................................................................................................................................................95
4.4.1 定义和实现接口...................................................................................................................96
4.4.2 派生的接口...........................................................................................................................98
4.5 小结................................................................................................................................................100
第5 章数组...........................................................................................................................................101
5.1 简单数组........................................................................................................................................101
5.1.1 数组的声明.........................................................................................................................101
5.1.2 数组的初始化.....................................................................................................................101
5.1.3 访问数组元素.....................................................................................................................102
5.1.4 使用引用类型.....................................................................................................................102
5.2 多维数组........................................................................................................................................103
5.3 锯齿数组........................................................................................................................................104
5.4 Array 类......................................................................................................................................... 105
5.4.1 属性.....................................................................................................................................105
5.4.2 创建数组.............................................................................................................................105
5.4.3 复制数组.............................................................................................................................106
5.4.4 排序.....................................................................................................................................107
5.5 数组和集合接口............................................................................................................................110
5.5.1 IEumerable 接口................................................................................................................. 110
5.5.2 ICollection 接口..................................................................................................................110
5.5.3 IList 接口............................................................................................................................ 110
5.6 枚举................................................................................................................................................110
5.6.1 IEnumerator 接口................................................................................................................111
5.6.2 foreach 语句........................................................................................................................111
5.6.3 yield 语句............................................................................................................................111
5.7 小结................................................................................................................................................116
第6 章运算符和类型强制转换................................................................................................................116
6.1 运算符............................................................................................................................................116
6.1.1 运算符的简化操作.............................................................................................................117
6.1.2 条件运算符.........................................................................................................................118
6.1.3 checked 和unchecked 运算符............................................................................................119
6.1.4 is 运算符............................................................................................................................. 119
6.1.5 as 运算符............................................................................................................................ 120
6.1.6 sizeof 运算符...................................................................................................................... 120
6.1.7 typeof 运算符......................................................................................................................120
6.1.8 可空类型和运算符.............................................................................................................120
6.1.9 空接合运算符.....................................................................................................................121
6.1.10 运算符的优先级...............................................................................................................121
6.2 类型的安全性................................................................................................................................121
6.2.1 类型转换.............................................................................................................................122
6.2.2 装箱和拆箱.........................................................................................................................124
6.3 对象的相等比较............................................................................................................................125
6.3.1 引用类型的相等比较.........................................................................................................125
6.3.2 值类型的相等比较.............................................................................................................126
6.4 运算符重载....................................................................................................................................126
6.4.1 运算符的工作方式.............................................................................................................127
6.4.2 运算符重载的示例:Vector 结构..................................................................................... 128
6.5 用户定义的数据类型转换............................................................................................................134
6.5.1 执行用户定义的类型转换.................................................................................................135
6.5.2 多重数据类型转换.............................................................................................................139
6.6 小结................................................................................................................................................142
第7 章委托和事件....................................................................................................................................143
7.1 委托................................................................................................................................................143
7.1.1 在C#中声明委托............................................................................................................... 144
7.1.2 在C#中使用委托............................................................................................................... 145
7.1.3 简单的委托示例.................................................................................................................147
7.1.4 BubbleSorter 示例.............................................................................................................. 149
7.1.5 多播委托.............................................................................................................................151
7.1.6 匿名方法.............................................................................................................................154
7.1.7 (表达式.............................................................................................................................. 155
7.1.8 协变和抗变.........................................................................................................................157
7.2 事件................................................................................................................................................158
7.2.1 从接收器的角度讨论事件.................................................................................................159
7.2.2 生成事件.............................................................................................................................160
7.3 小结................................................................................................................................................164
第8 章字符串和正则表达式....................................................................................................................165
8.1 System.String 类............................................................................................................................ 165
8.1.1 创建字符串.........................................................................................................................166
8.1.2 StringBuilder 成员.............................................................................................................. 168
8.1.3 格式化字符串.....................................................................................................................169
8.2 正则表达式....................................................................................................................................174
8.2.1 正则表达式概述.................................................................................................................174
8.2.2 RegularExpressionsPlayaround 示例..................................................................................175
8.2.3 显示结果.............................................................................................................................177
8.2.4 匹配、组合和捕获.............................................................................................................178
8.3 小结................................................................................................................................................179
第9 章泛型...........................................................................................................................................180
9.1 概述................................................................................................................................................181
9.1.1 性能.....................................................................................................................................181
9.1.2 类型安全.............................................................................................................................182
9.1.3 二进制代码的重用.............................................................................................................182
9.1.4 代码的扩展.........................................................................................................................183
9.1.5 命名约定.............................................................................................................................183
9.2 创建泛型类....................................................................................................................................183
9.3 泛型类的特性................................................................................................................................187
9.3.1 默认值.................................................................................................................................188
9.3.2 约束.....................................................................................................................................188
9.3.3 继承.....................................................................................................................................190
9.3.4 静态成员.............................................................................................................................191
9.4 泛型接口........................................................................................................................................191
9.5 泛型方法........................................................................................................................................192
9.6 泛型委托........................................................................................................................................194
9.6.1 执行委托调用的方法.........................................................................................................194
9.6.2 对Array 类使用泛型委托..................................................................................................196
9.7 Framework 的其他泛型类型........................................................................................................ 198
9.7.1 结构Nullable............................................................................................................... 198
9.7.2 EventHandler...............................................................................................199
9.8 小结................................................................................................................................................200
第10 章集合..............................................................................................................................................200
10.1 集合接口和类型..........................................................................................................................201
10.2 列表..............................................................................................................................................203
10.2.1 创建列表...........................................................................................................................205
10.2.2 只读集合...........................................................................................................................212
10.3 队列..............................................................................................................................................212
10.4 栈..................................................................................................................................................216
10.5 链表..............................................................................................................................................217
10.6 有序表..........................................................................................................................................222
10.7 字典..............................................................................................................................................224
10.7.1 键的类型...........................................................................................................................224
10.7.2 字典示例...........................................................................................................................225
10.7.3 Lookup 类......................................................................................................................... 228
10.7.4 其他字典类.......................................................................................................................229
10.8 HashSet........................................................................................................................................ 230
10.9 位数组..........................................................................................................................................233
10.9.1 BitArray.............................................................................................................................233
10.9.2 BitVector32....................................................................................................................... 235
10.10 性能............................................................................................................................................237
10.11 小结............................................................................................................................................238
第11 章Language Integrated Query..........................................................................................................239
11.1 LINQ 概述........................................................................................................................... 240
11.1.1 使用List的查询.........................................................................................................240
11.1.2 扩展方法...........................................................................................................................251
11.1.3 λ表达式.............................................................................................................................253
11.1.4 LINQ 查询........................................................................................................................ 254
11.1.5 推迟查询的执行...............................................................................................................255
11.2 标准的查询操作符..............................................................................................................258
11.2.1 过滤...................................................................................................................................259
11.2.2 用索引来过滤...................................................................................................................260
11.2.3 类型过滤...........................................................................................................................260
11.2.4 复合的from 子句............................................................................................................. 261
11.2.5 排序...................................................................................................................................263
11.2.6 分组...................................................................................................................................264
11.2.7 对嵌套的对象分组...........................................................................................................266
11.2.8 连接...................................................................................................................................267
11.2.9 设置操作...........................................................................................................................270
11.2.10 分区.................................................................................................................................271
11.2.11 合计操作符.....................................................................................................................273
11. 2 . 12 转换.................................................................................................................... 275
11.2.13 生成操作符.....................................................................................................................277
11.3 表达式树..............................................................................................................................278
11.4 LINQ 提供程序................................................................................................................... 282
11.5 小结......................................................................................................................................283
下载地址
 下载地址1
按字母检索

下载须知:
大部份资源无需注册即可下载
需要积分的资源要在会员中心注册会员并用 积分体系中提示的方法赚取积分才能下载。

免责声明:
所有资源只能用于参考学习,不能用于任何商业用途,否则后果自负!