C# 5.0 in a Nutshell(5th)

来源:https://www.cnblogs.com/liulangdemao/archive/2018/10/30/9878562.html
-Advertisement-
Play Games

好書。C#演化到5.0,各種特性層出不窮,想窮盡所有做一個全面的介紹往往到頭來都是費力不討好。但這本書基本上做到了,可能有些部分不夠詳盡,但在1000多頁的篇幅幾乎沒有濫竽充數的內容,代碼示例都非常精當,值得一讀。 需要學習的朋友可以通過網盤免費下載pdf版 (先點擊普通下載 再選擇普通用戶就能免費 ...


好書。C#演化到5.0,各種特性層出不窮,想窮盡所有做一個全面的介紹往往到頭來都是費力不討好。但這本書基本上做到了,可能有些部分不夠詳盡,但在1000多頁的篇幅幾乎沒有濫竽充數的內容,代碼示例都非常精當,值得一讀。

需要學習的朋友可以通過網盤免費下載pdf版 (先點擊普通下載-----再選擇普通用戶就能免費下載了)

http://putpan.com/fs/fyi6be7ns2hu8fb97/

本書是英文的哈:

內容簡介  · · · · · ·

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

需要IT編程經典書籍資源大合集百度網盤鏈接的加qq 2057904338,不需要的也可以加喲,本人python全棧工程獅一枚,要咨詢python或者IT行業的朋友可以相互探討學習下,就當交個朋友吧!


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • tensorflow急切執行概述 Eager execution is an imperative, define by run interface where operations are executed immediately as they are called from Python. T ...
  • 目錄: 一.知識點: 1.運算符 2.符號 3.運算 4.邏輯運算 5.while 迴圈 6.break 和 continue 7.while語句的變化 8.特殊表示 二.例題: 1.例子:比較三個數的大小:num1 num2 num3 2.例子:不斷的輸入年齡,直到輸入正確的年齡才結束,不... ...
  • 1、函數動態傳參 *args : 將所有的位置參數打包成一個元組的形式. **kwargs : 將所有的關鍵字參數打包成一個字典的形式. 形參的接收順序: 位置參數 > *args > 預設值參數> **kwargs. 2、命名空間 命名空間: 在python解釋器執行後, 記憶體中開闢的一塊用於存放 ...
  • 幾年前,“數學之美”系列文章原刊載於谷歌黑板報,獲得上百萬次點擊,得到讀者高度評價。讀者說,讀了“數學之美”,才發現大學時學的數學知識,比如馬爾可夫鏈、矩陣計算,甚至餘弦函數原來都如此親切,並且栩栩如生,才發現自然語言和信息處理這麼有趣。 在紙本書的創作中,作者吳軍博士幾乎把所有文章都重寫了一遍,為 ...
  • 以前項目中使用了websocket-sharp,挺好用。可惜,不支持.net core。好在手動編譯很順利: ...
  • 初次學習Asp.Net Core方面的東西,雖然研究的還不是很深,今天主要是學習了一下Asp.Net Core WebAPI項目的使用,發現與Asp.Net WebAPI項目還是有很多不同。不同點包含且不限如下幾點: 1.Asp.Net Core WebAPI創建的控制器類文件繼承的是Control ...
  • [TOC] C 學習筆記之值類型與引用類型 1.值類型與引用類型 1.1 深層區別 值類型與引用類型有不同的記憶體分佈,這導致了不同的記憶體管理機制: 值類型由OS負責記憶體管理 引用類型由垃圾回收器(GC)負責記憶體管理 記憶體管理:指的是對記憶體的分配與釋放的管理 1.2 值類型與引用類型的嵌套使用 1.2 ...
  • 步驟: 1. 創建一個asp.net mvc 項目 1.1 項目創建好結構如下 2 通過vs安裝EntityFramework框架 install-package entityframework 3. 創建一個繼承DBContext的 MyContext類,並引用命名空間 using System. ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...