C# 5.0 in a Nutshell(5th)
好书。c#演化到5.0,各种特性层出不穷,想穷尽所有做一个全面的介绍往往到头来都是费力不讨好。但这本书基本上做到了,可能有些部分不够详尽,但在1000多页的篇幅几乎没有滥竽充数的内容,代码示例都非常精当,值得一读。
需要学习的朋友可以通过网盘免费下载pdf版 (先点击普通下载-----再选择普通用户就能免费下载了)
本书是英文的哈:
内容简介 · · · · · ·
when you have a question about how to use c# 5.0 or the .net clr, this highly acclaimed bestseller has precisely the answers you need. uniquely organized around concepts and use cases, this fifth edition include in-depth cover of concurrency and asynchrony new to c# 5.0 as well as continued coverage of parallel programming, code contracts, dynamic programming, security and com interoperability. you'll also find updated information on language enhancements such as caller info attributes, readonlydictionary, web sockets, and the new httpclient class. this handy book has all you need to stay on track with c# 5.0. get up to speed on c# language basics, including syntax, types, and variables explore advanced topics such as unsafe code and preprocessor directives learn c# 5.0 features such as concurrency and asynchrony work with .net 4.5's rich set of features for parallel programming, code contracts, and the code security model understand .net topics, including xml, collections, i/o and networking, memory management, reflection, attributes, security, and native interoperability
目录
1. introducing c# and the .net framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 object orientation 1
type safety 2 memory management 2 platform support 3
c#’s relationship with the clr 3
the clr and .net framework 3
c# and windows runtime 5 what’s new in c# 5.0 6 what’s new in c# 4.0 6 what’s new in c# 3.0 7
2. c# language basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 a first c# program 9 syntax 12 type basics 15 numeric types 23 boolean type and operators 30 strings and characters 32 arrays 34 variables and parameters 38 expressions and operators 47 statements 51 namespaces
3. creating types in c# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 classes 67 inheritance 80 the object type 89 structs 93 access modifiers 94 interfaces 96 enums 102 nested types 105 generics 106
4. advanced c# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 delegates 119 events 128 lambda expressions 135 anonymous methods 139 try statements and exceptions 140 enumeration and iterators 148 nullable types 153 operator overloading 158 extension methods 162 anonymous types 164 dynamic binding 165 attributes 173 caller info attributes (c# 5) 175 unsafe code and pointers 177 preprocessor directives 180 xml documentation 182
5. framework overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 the clr and core framework 189 applied technologies 194
6. framework fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201 string and text handling 201 dates and times 214 dates and time zones 221 formatting and parsing 227 standard format strings and parsing flags 233 other conversion mechanisms 240 globalization 244 working with numbers 245 enums 249 tuples 252 the guid struct
equality comparison 254 order comparison 264 utility classes 267
7. collections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271 enumeration 271 the icollection and ilist interfaces 279 the array class 282 lists, queues, stacks, and sets 291 dictionaries 299 customizable collections and proxies 306 plugging in equality and order 312
8. linq queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319 getting started 319 fluent syntax 321 query expressions 328 deferred execution 332 subqueries 338 composition strategies 342 projection strategies 345 interpreted queries 347 linq to sql and entity framework 354 building query expressions 368
9. linq operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375 overview 377 filtering 379 projecting 383 joining 395 ordering 403 grouping 406 set operators 409 conversion methods 410 element operators 413 aggregation methods 415 quantifiers 419 generation methods 420
10. linq to xml . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423 architectural overview 423 x-dom overview 424 instantiating an x-dom 427 navigating and querying 430 updating an x-dom
working with values 438 documents and declarations 441 names and namespaces 444 annotations 450 projecting into an x-dom 450
11. other xml technologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457 xmlreader 458 xmlwriter 467 patterns for using xmlreader/xmlwriter 469 xmldocument 473 xpath 477 xsd and schema validation 481 xslt 484
12. disposal and garbage collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485 idisposable, dispose, and close 485 automatic garbage collection 490 finalizers 493 how the garbage collector works 497 managed memory leaks 501 weak references 505
13. diagnostics and code contracts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509 conditional compilation 509 debug and trace classes 512 code contracts overview 516 preconditions 520 postconditions 524 assertions and object invariants 527 contracts on interfaces and abstract methods 528 dealing with contract failure 529 selectively enforcing contracts 531 static contract checking 533 debugger integration 535 processes and process threads 536 stacktrace and stackframe 537 windows event logs 538 performance counters 541 the stopwatch class 545
14. concurrency & asynchrony . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547 introduction 547 threading 548 tasks
principles of asynchrony 573 asynchronous functions in c# 5.0 578 asynchronous patterns 594 obsolete patterns 601
15. streams and i/o . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605 stream architecture 605 using streams 607 stream adapters 621 compression streams 629 working with zip files 631 file and directory operations 632 file i/o in windows runtime 642 memory-mapped files 644 isolated storage 647
16. networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 653 network architecture 653 addresses and ports 655 uris 656 client-side classes 658 working with http 671 writing an http server 677 using ftp 680 using dns 682 sending mail with smtpclient 683 using tcp 683 receiving pop3 mail with tcp 687 tcp in windows runtime 689
17. serialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691 serialization concepts 691 the data contract serializer 695 data contracts and collections 705 extending data contracts 707 the binary serializer 710 binary serialization attributes 712 binary serialization with iserializable 715 xml serialization 719
18. assemblies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729 what’s in an assembly 729 strong names and assembly signing 734 assembly names 737 authenticode signing
the global assembly cache 743 resources and satellite assemblies 745 resolving and loading assemblies 754 deploying assemblies outside the base folder 759 packing a single-file executable 760 working with unreferenced assemblies 762
19. reflection and metadata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765 reflecting and activating types 766 reflecting and invoking members 773 reflecting assemblies 785 working with attributes 786 dynamic code generation 792 emitting assemblies and types 799 emitting type members 803 emitting generic methods and types 808 awkward emission targets 810 parsing il 814
20. dynamic programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 821 the dynamic language runtime 821 numeric type unification 823 dynamic member overload resolution 824 implementing dynamic objects 830 interoperating with dynamic languages 833
21. security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 837 permissions 837 code access security (cas) 842 allowing partially trusted callers 845 the transparency model 847 sandboxing another assembly 855 operating system security 858 identity and role security 861 cryptography overview 862 windows data protection 863 hashing 864 symmetric encryption 865 public key encryption and signing 870
22. advanced threading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 875 synchronization overview 876 exclusive locking 876 locking and thread safety 884 non-exclusive locking
signaling with event wait handles 895 the barrier class 903 lazy initialization 904 thread-local storage 907 interrupt and abort 909 suspend and resume 910 timers 911
23. parallel programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 915 why pfx? 915 plinq 918 the parallel class 931 task parallelism 938 working with aggregateexception 947 concurrent collections 949 blockingcollection<t> 952
24. application domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 957 application domain architecture 957 creating and destroying application domains 958 using multiple application domains 960 using docallback 962 monitoring application domains 963 domains and threads 963 sharing data between domains 965
25. native and com interoperability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 971 calling into native dlls 971 type marshaling 972 callbacks from unmanaged code 975 simulating a c union 975 shared memory 976 mapping a struct to unmanaged memory 979 com interoperability 983 calling a com component from c# 985 embedding interop types 988 primary interop assemblies 989 exposing c# objects to com 990
26. regular expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 991 regular expression basics 992 quantifiers 996 zero-width assertions 997 groups 1000 replacing and splitting text
上一篇: myeclipse的debug模式启动不了,但run模式可以启动
下一篇: 最课程站点使用手记