2006 oreilly c sharp cookbook, 2nd edition

2K 173 0
2006   oreilly   c sharp cookbook, 2nd edition

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

C# Cookbook, 2nd Edition By Jay Hilyard, Stephen Teilhet Publisher: O'Reilly Pub Date: January 2006 Print ISBN-10: 0-596-10063-9 Print ISBN-13: 978-0-59-610063-6 Pages: 1184 Table of Contents | Index With C# Cookbook, 2nd Edition, you'll be able to learn and improve your mastery of both the C# language and the NET platform This updated bestseller has been completely revised to account for C# 2.0, the latest version of this popular object-oriented programming language It also includes more than 100 new code solutions (over 300 overall) to common problems and tasks that you're sure to face as a C# programmer Nearly every solution, or "recipe," contains a complete, documented code sample showing you how to solve the specific problem, as well as a detailed discussion of how and why the underling technology works This question-solution-discussion format is a proven teaching method, as any fan of O'Reilly's "Cookbook" series can attest to In fact, no other source offers a learn-as-you-go format quite like this C# Cookbook, 2nd Edition is organized into 20 chapters, each of which focuses on a particular topic in creating C# solutions Here's just a taste of what's covered: Numeric data types Strings and characters Classes and structures Generics Exception handling Delegates, events, and anonymous methods Filesystem interactions Web site access XML usage (including XPath and XSLT) Networking Threading Unsafe code Best of all, you don't have to be an experienced C# or NET developer to use C# Cookbook, 2nd Edition You just have to be someone who wants to solve a problem now, without having to learn all the related theory first C# Cookbook, 2nd Edition By Jay Hilyard, Stephen Teilhet Publisher: O'Reilly Pub Date: January 2006 Print ISBN-10: 0-596-10063-9 Print ISBN-13: 978-0-59-610063-6 Pages: 1184 Table of Contents | Index Copyright Dedication Preface Who This Book Is For What You Need to Use This Book Platform Notes How This Book Is Organized What Was Left Out Conventions Used in This Book About the Code Using Code Examples Comments and Questions Safari Enabled Acknowledgments Chapter 1 Numbers and Enumerations Introduction Recipe 1.1 Determining Approximate Equality Between a Fraction and FloatingPoint Value Recipe 1.2 Converting Degrees to Radians Recipe 1.3 Converting Radians to Degrees Recipe 1.4 Using the Bitwise Complement Operator with Various Data Types Recipe 1.5 Testing for an Even or Odd Value Recipe 1.6 Obtaining the High Word or Low Word of a Number Recipe 1.7 Converting a Number in Another Base to Base10 Recipe 1.8 Determining Whether a String Is a Valid Number Recipe 1.9 Rounding a Floating-Point Value Recipe 1.10 Choosing a Rounding Algorithm Recipe 1.11 Converting Celsius to Fahrenheit Recipe 1.12 Converting Fahrenheit to Celsius Recipe 1.13 Safely Performing a Narrowing Numeric Cast Recipe 1.14 Finding the Length of Any Three Sides of a Right Triangle Recipe 1.15 Finding the Angles of a Right Triangle Recipe 1.16 Displaying an Enumeration Value as a String Recipe 1.17 Converting Plain Text to an Equivalent Enumeration Value Recipe 1.18 Testing for a Valid Enumeration Value Recipe 1.19 Testing for a Valid Enumeration of Flags Recipe 1.20 Using Enumerated Members in a Bit Mask Recipe 1.21 Determining if One or More Enumeration Flags Are Set Recipe 1.22 Determining the Integral Part of a Decimal or Double Chapter 2 Strings and Characters Introduction Recipe 2.1 Determining the Kind of Character a char Contains Recipe 2.2 Determining Whether a Character Is Within a Specified Range Recipe 2.3 Controlling Case Sensitivity When Comparing Two Characters Recipe 2.4 Finding All Occurrences of a Character Within a String Recipe 2.5 Finding the Location of All Occurrences of a String Within Another String Recipe 2.6 Implementing a Poor Man's Tokenizer to Deconstruct a String Recipe 2.7 Controlling Case Sensitivity When Comparing Two Strings Recipe 2.8 Comparing a String to the Beginning or End of a Second String Recipe 2.9 Inserting Text into a String Recipe 2.10 Removing or Replacing Characters Within a String Recipe 2.11 Encoding Binary Data as Base64 Recipe 2.12 Decoding a Base64-Encoded Binary Recipe 2.13 Converting a String Returned as a Byte[ ] Back into a String Recipe 2.14 Passing a String to a Method That Accepts only a Byte[ ] Recipe 2.15 Converting Strings to Other Types Recipe 2.16 Formatting Data in Strings Recipe 2.17 Creating a Delimited String Recipe 2.18 Extracting Items from a Delimited String Recipe 2.19 Setting the Maximum Number of Characters a StringBuilder Can Contain Recipe 2.20 Iterating over Each Character in a String Recipe 2.21 Improving String Comparison Performance Recipe 2.22 Improving StringBuilder Performance Recipe 2.23 Pruning Characters from the Head and/or Tail of a String Recipe 2.24 Testing a String for Null or Empty Recipe 2.25 Appending a Line Recipe 2.26 Encoding Chunks of Data Chapter 3 Classes and Structures Introduction Recipe 3.1 Creating Union-Type Structures Recipe 3.2 Allowing a Type to Represent Itself as a String Recipe 3.3 Converting a String Representation of an Object into an Actual Object Recipe 3.4 Implementing Polymorphism with Abstract Base Classes Recipe 3.5 Making a Type Sortable Recipe 3.6 Making a Type Searchable Recipe 3.7 Indirectly Overloading the +=, -=, /=, and *= Operators Recipe 3.8 Indirectly Overloading the &&, ||, and ?: Operators Recipe 3.9 Turning Bits On or Off Recipe 3.10 Making Error-Free Expressions Recipe 3.11 Minimizing (Reducing) Your Boolean Logic Recipe 3.12 Converting Between Simple Types in a Language-Agnostic Manner Recipe 3.13 Determining When to Use the Cast Operator, the as Operator, or the is Operator Recipe 3.14 Casting with the as Operator Recipe 3.15 Determining a Variable's Type with the is Operator Recipe 3.16 Implementing Polymorphism with Interfaces Recipe 3.17 Calling the Same Method on Multiple Object Types Recipe 3.18 Adding a Notification Callback Using an Interface Recipe 3.19 Using Multiple Entry Points to Version an Application Recipe 3.20 Preventing the Creation of an Only Partially Initialized Object Recipe 3.21 Returning Multiple Items from a Method Recipe 3.22 Parsing Command-Line Parameters Recipe 3.23 Retrofitting a Class to Interoperate with COM Recipe 3.24 Initializing a Constant Field at Runtime Recipe 3.25 Writing Code That Is Compatible with the Widest Range of Managed Languages Recipe 3.26 Building Cloneable Classes Recipe 3.27 Assuring an Object's Disposal Recipe 3.28 Releasing a COM Object Through Managed Code Recipe 3.29 Creating an Object Cache Recipe 3.30 Rolling Back Object Changes Recipe 3.31 Disposing of Unmanaged Resources Recipe 3.32 Determining Where Boxing and Unboxing Occur Chapter 4 Generics Introduction Recipe 4.1 Deciding When and Where to Use Generics Recipe 4.2 Understanding Generic Types Recipe 4.3 Getting the Type of a Generic Type Recipe 4.4 Replacing the ArrayList with Its Generic Counterpart Recipe 4.5 Replacing the Stack and Queue with Their Generic Counterparts Recipe 4.6 Implementing a Linked List Recipe 4.7 Creating a Value Type That Can Be Initialized to Null Recipe 4.8 Reversing the Contents of a Sorted List Recipe 4.9 Making Read-Only Collections the Generic Way Recipe 4.10 Replacing the Hashtable with Its Generic Counterpart Recipe 4.11 Using foreach with Generic Dictionary Types Recipe 4.12 Constraining Type Arguments Recipe 4.13 Initializing Generic Variables to Their Default Values Chapter 5 Collections Introduction Recipe 5.1 Swapping Two Elements in an Array Recipe 5.2 Reversing an Array Quickly Recipe 5.3 Reversing a Two-Dimensional Array Recipe 5.4 Reversing a Jagged Array Recipe 5.5 Writing a More Flexible StackTrace Class Recipe 5.6 Determining the Number of Times an Item Appears in a List Recipe 5.7 Retrieving All Instances of a Specific Item in a List Recipe 5.8 Inserting and Removing Items from an Array Recipe 5.9 Keeping Your List Sorted Recipe 5.10 Sorting a Dictionary's Keys and/or Values Recipe 5.11 Creating a Dictionary with Max and Min Value Boundaries Recipe 5.12 Displaying an Array's Data as a Delimited String Recipe 5.13 Storing Snapshots of Lists in an Array Recipe 5.14 Persisting a Collection Between Application Sessions Recipe 5.15 Testing Every Element in an Array or List Recipe 5.16 Performing an Action on Each Element in an Array or List Recipe 5.17 Creating a Read-Only Array or List Chapter 6 Iterators and Partial Types Introduction Recipe 6.1 Implementing Nested foreach Functionality in a Class Recipe 6.2 Creating Custom Enumerators Recipe 6.3 Creating an Iterator on a Generic Type Recipe 6.4 Creating an Iterator on a Non-generic Type Recipe 6.5 Creating Iterators That Accept Parameters Recipe 6.6 Adding Multiple Iterators on a Single Type Recipe 6.7 Implementing Iterators as Overloaded Operators Recipe 6.8 Forcing an Iterator to Stop Iterating Recipe 6.9 Dealing with Finally Blocks and Iterators Recipe 6.10 Organizing Your Interface Implementations Recipe 6.11 Generating Code That Is No Longer in Your Main Code Paths Chapter 7 Exception Handling Introduction Recipe 7.1 Verifying Critical Parameters Recipe 7.2 Knowing When to Catch and Rethrow Exceptions Recipe 7.3 Identifying Exceptions and Their Usage Recipe 7.4 Handling Derived Exceptions Individually Recipe 7.5 Assuring Exceptions Are Not Lost When Using Finally Blocks Recipe 7.6 Handling Exceptions Thrown from Methods Invoked via Reflection Recipe 7.7 Debugging Problems When Loading an Assembly Recipe 7.8 Mapping Back and Forth Between Managed Exceptions and HRESULTs Recipe 7.9 Handling User-Defined HRESULTs Recipe 7.10 Preventing Unhandled Exceptions Recipe 7.11 Getting Exception Information Recipe 7.12 Getting to the Root of a Problem Quickly Recipe 7.13 Creating a New Exception Type Recipe 7.14 Obtaining a Stack Trace Recipe 7.15 Breaking on a First-Chance Exception Recipe 7.16 Preventing the Nefarious TypeInitializationException Recipe 7.17 Handling Exceptions Thrown from an Asynchronous Delegate Recipe 7.18 Giving Exceptions the Extra Info They Need with Exception.Data Recipe 7.19 Looking at Exceptions in a New Way Using Visualizers Recipe 7.20 Dealing with Unhandled Exceptions in WinForms Applications Chapter 8 Diagnostics Introduction Recipe 8.1 Controlling Tracing Output in Production Code Recipe 8.2 Providing Fine-Grained Control over Debugging/Tracing Output Recipe 8.3 Creating Your Own Custom Switch Class Recipe 8.4 Compiling Blocks of Code Conditionally Recipe 8.5 Determining Whether a Process Has Stopped Responding Recipe 8.6 Using Event Logs in Your Application Recipe 8.7 Changing the Maximum Size of a Custom Event Log Recipe 8.8 Searching Event Log Entries Recipe 8.9 Watching the Event Log for a Specific Entry Recipe 8.10 Finding All Sources Belonging to a Specific Event Log Recipe 8.11 Implementing a Simple Performance Counter Recipe 8.12 Implementing Performance Counters That Require a Base Counter Recipe 8.13 Enabling and Disabling Complex Tracing Code Recipe 8.14 Capturing Standard Output for a Process Recipe 8.15 Creating Custom Debugging Displays for Your Classes Recipe 8.16 Determining Current appdomain Settings Information Recipe 8.17 Boosting the Priority of a Process Programmatically Recipe 8.18 Looking at Your Runtime Environment and Seeing What You Can Do About It Chapter 9 Delegates, Events, and Anonymous Methods Introduction Recipe 9.1 Controlling When and If a Delegate Fires Within a Multicast Delegate Recipe 9.2 Obtaining Return Values from Each Delegate in a Multicast Delegate Recipe 9.3 Handling Exceptions Individually for Each Delegate in a Multicast Delegate Recipe 9.4 Converting Delegate Invocation from Synchronous to Asynchronous Recipe 9.5 Wrapping Sealed Classes to Add Events Recipe 9.6 Passing Specialized Parameters to and from an Event Recipe 9.7 An Advanced Interface Search Mechanism Recipe 9.8 An Advanced Member Search Mechanism Recipe 9.9 Observing Additions and Modifications to a Hashtable Recipe 9.10 Using the Windows Keyboard Hook Recipe 9.11 Tracking and Responding to the Mouse Recipe 9.12 Using Anonymous Methods Recipe 9.13 Set up Event Handlers Without the Mess Recipe 9.14 Using Different Parameter Modifiers in Anonymous Methods Recipe 9.15 Using Closures in C# Recipe 9.16 Performing Multiple Operations on a List Using Functors Chapter 10 Regular Expressions Introduction Recipe 10.1 Enumerating Matches Recipe 10.2 Extracting Groups from a MatchCollection Recipe 10.3 Verifying the Syntax of a Regular Expression Recipe 10.4 Quickly Finding Only the Last Match in a String Recipe 10.5 Replacing Characters or Words in a String Recipe 10.6 Augmenting the Basic String Replacement Function Recipe 10.7 Implementing a Better Tokenizer Recipe 10.8 Compiling Regular Expressions Recipe 10.9 Counting Lines of Text Recipe 10.10 Returning the Entire Line in Which a Match Is Found Recipe 10.11 Finding a Particular Occurrence of a Match Recipe 10.12 Using Common Patterns Recipe 10.13 Documenting Your Regular Expressions Recipe 10.14 Using Built-in Regular Expressions to Parse ASP NET Pages Chapter 11 Data Structures and Algorithms Introduction Recipe 11.1 Creating a Hash Code for a Data Type Recipe 11.2 Creating a Priority Queue Recipe 11.3 Creating a Double Queue Recipe 11.4 Determining Where Characters or Strings Do Not Balance Recipe 11.5 Creating a One-to-Many Map (MultiMap) Recipe 11.6 Creating a Binary Tree Recipe 11.7 Creating an n-ary Tree Recipe 11.8 Creating a Set Object Chapter 12 Filesystem I/O Introduction Recipe 12.1 Creating, Copying, Moving, or Deleting a File Recipe 12.2 Manipulating File Attributes Recipe 12.3 Renaming a File Recipe 12.4 Determining Whether a File Exists Recipe 12.5 Choosing a Method of Opening a File or Stream for Reading and/or Writing Recipe 12.6 Accessing Part of a File Randomly Recipe 12.7 Outputting a Platform-Independent EOL Character Recipe 12.8 Creating, Writing to, and Reading from a File Recipe 12.9 Determining Whether a Directory Exists Recipe 12.10 Creating, Copying, Moving, or Deleting a Directory Recipe 12.11 Manipulating Directory Attributes Recipe 12.12 Renaming a Directory Recipe 12.13 Searching for Directories or Files Using Wildcards Recipe 12.14 Obtaining the Directory Tree Recipe 12.15 Parsing a Path Recipe 12.16 Parsing Paths in Environment Variables Recipe 12.17 Verifying a Path Recipe 12.18 Using a Temporary File in Your Application Recipe 12.19 Opening a File Stream with Just a File Handle Recipe 12.20 Writing to Multiple Output Files at One Time Recipe 12.21 Launching and Interacting with Console Utilities Recipe 12.22 Locking Subsections of a File Recipe 12.23 Watching the Filesystem for Specific Changes to One or More Files or Directories Recipe 12.24 Waiting for an Action to Occur in the Filesystem Recipe 12.25 Comparing Version Information of Two Executable Modules Recipe 12.26 Querying Information for All Drives on a System Recipe 12.27 Encrypting/Decrypting an Existing File Recipe 12.28 Compressing and Decompressing Your Files Chapter 13 Reflection Introduction Recipe 13.1 Listing Referenced Assemblies Recipe 13.2 Listing Exported Types Recipe 13.3 Finding Overridden Methods Recipe 13.4 Finding Members in an Assembly Recipe 13.5 Finding Members Within an Interface Recipe 13.6 Determining and Obtaining Nested Types Within an Assembly Recipe 13.7 Displaying the Inheritance Hierarchy for a Type Recipe 13.8 Finding the Subclasses of a Type Recipe 13.9 Finding All Serializable Types Within an Assembly Recipe 13.10 Filtering Output When Obtaining Members Recipe 13.11 Dynamically Invoking Members Recipe 13.12 Providing Guidance to Obfuscators Recipe 13.13 Determining if a Type or Method Is Generic Recipe 13.14 Reading Manifest Resources Programmatically Recipe 13.15 Accessing Local Variable Information Recipe 13.16 Creating a Generic Type Chapter 14 Web Introduction Recipe 14.1 Converting an IP Address to a Hostname Recipe 14.2 Converting a Hostname to an IP Address creating for files directory displaying or manipulating for files ToASCIIByteArray method ToBase64CharArray method ToBoolean method ToByte method ToChar method ToDateTime method ToDecimal method ToDouble method ToInt16 method ToInt32 method ToInt32 method (Convert) ToInt64 method Tokenize method ToSByte method ToSingle method ToString method controlling display of information 2nd 3rd 4th 5th 6th displaying exception information exception information Exception type exceptions formatting with using with exceptions ToString methods ToUInt16 method ToUInt32 method ToUInt64 method ToUnicodeByteArray method ToUpper method Trace class trace element Traceable class 2nd TraceFactory class 2nd 3rd 4th TraceSwitch class 2nd tracing levels tracing configuration file to turn on generating code for during object creation 2nd output from production application 2nd 3rd 4th 5th selecting levels of Transform method TransformXML method trees binary tree 2nd TreeSize property Trim method TriValue partial class support for Iconvertible interface 2nd 3rd true operator overloading TrueForAll method try blocks try-catch exception handlers when to use try-catch-finally exception handlers when to use try-finally exception handlers when to use try/catch block wrapping around Main method try/catch blocks nested preventing unhandled exceptions with within finally blocks try/catch/finally blocks try/finally blocks TryEnter method TryParse method TurnBitOff method TurnBitOn method TurnBitPositionOff method TurnBitPositionOn method two-dimensional arrays reversing type argument Type class methods accepting BindingFlags enumerator searching for interfaces with type conversions 2nd type parameters in generics type safety generic replacements for Queue and Stack objects provided by generic types TypeFilter delegate TypeInitializationException exception preventing TypeLoadException exception typeof operator types serializable TypeUnloadedException exception Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] [Z] unary functions UnAttachCallback method UnauthorizedAccessException exception unchecked context understanding generic types boxing UnescapeDataString method 2nd unhandled exceptions in WinForms applications UnhandledExceptionEventHandler method UnhookWindowsHookEx function union of set objects UnionOf method unions 2nd Unlock method unmanaged resources 2nd 3rd 4th 5th 6th unnamed groups in regular expressions UnRegister method unsafe code unknown pointer types UploadValues method 2nd URI (Uniform Resource Identifier) absolute 2nd escaping/unescaping data for web operations Uri class 2nd UriBuilder class 2nd UriBuilderFix class URL obtaining HTML from reading XML data from UseMedia method UserEventArgs class UseShellExecute property (ProcessInfo) using directive using statement dispose pattern important points about UTF-16 encoded values Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] [Z] Validate method 2nd 3rd ValidateXML method ValidationEventArgs class ValidationEventHandler class 2nd ValidationType enumeration Value method 2nd value types creating type that can be initialized to null Values property 2nd variables defined in using statement determining type with is operator generic vector array VerificationException exception VerifyRegEx method 2nd 3rd versioning application 2nd 3rd versions ViewModifyFileAttr method visibility of methods VisualizerDevelopmentHost class visualizers examining exceptions 2nd 3rd 4th 5th void pointers Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] [Z] WaitForChanged method 2nd WaitForMessage method WaitForZipCreation method WaitOne method WarningException exception WatchForAppEvent method WeakReference class WeakReferenceException exception web applications inspecting and changing configuration 2nd 3rd parsing HTML 2nd 3rd web browser 2nd 3rd web pages parsing ASP.NET pages web proxy web server custom error pages 2nd web.config file sqlCacheDependency WebBrowser class WebBrowserNavigatedEventArgs class WebClient class WebConfigurationManager class 2nd WebException exception WebProxy class WH_KEYBOARD hook 2nd 3rd 4th 5th 6th where keyword whitespace wildcards searching for members in assembly using using in searches for files or directories 2nd 3rd 4th 5th Windows file encryption/decryption Windows operating system event log 2nd 3rd 4th 5th 6th keyboard hook 2nd 3rd 4th 5th 6th WinForms applications unhandled exceptions WinForms-based application displaying HTML-based content 2nd WinInet (Windows Internet) API WriteByte method WriteCData method WriteDebuggerVisualizerAttribute method WriteElementString method WriteLine method formatting data using newline characters and WriteLine method (Console class) WriteNodeInfo method WriterDecorator class WriteToLog method 2nd Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] [Z] XDR schema 2nd XML exception data copied to clipboard XML (Extensible Markup Language) 2nd 3rd 4th 5th 6th 7th 8th 9th 10th 11th 12th 13th 14th 15th 16th 17th 18th 19th 20th 21st 22nd 23rd 24th 25th 26th 27th 28th 29th 30th 31st 32nd 33rd 34th 35th 36th 37th 38th 39th 40th 41st 42nd 43rd 44th 45th breaking document into constituent parts 2nd 3rd 4th 5th 6th constructing document from separate pieces 2nd 3rd 4th 5th creating document programmatically 2nd 3rd DOM model for extending XSLT transformations 2nd 3rd 4th finding tags in an XML string invalid characters in XML string 2nd 3rd 4th querying document contents 2nd 3rd 4th reading XML data in document order 2nd 3rd 4th tracking changes to 2nd 3rd transformations 2nd transforming validating conformance to a schema validating modified documents without reloading 2nd 3rd XML configuration file XML files application configuration file for WinForms- or Consolebased applications XmlAttributes class XmlDocument class assembling an XML document using 2nd constructing XML data using event handlers and WriteNodeInfo method when to use 2nd 3rd XmlElement class XmlException exception XmlNode class XmlNodeType enumeration XmlReader class 2nd 3rd 4th Create method validating XML 2nd 3rd 4th 5th 6th XmlReaderSettings class 2nd 3rd XmlResolver class XmlSchemaInference class XmlSchemaSet class XmlSecureResolver class XmlUrlResolver class 2nd XmlWriter class 2nd XmlWriterSettings class XPath 2nd 3rd 4th XPathDocument class 2nd XPathNavigator class 2nd XPathNodeIterator class 2nd 3rd XSD schema generating from existing XML files XML validation against XslCompiledTransform class 2nd XSLExtensionObject class XSLT passing parameters to transformations 2nd 3rd XSLT stylesheet XsltSettings class Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] [Z] yield break statement yield return statement 2nd Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] [Z] zip code ... Determining the Kind of Character a char Contains Recipe 2.2 Determining Whether a Character Is Within a Specified Range Recipe 2.3 Controlling Case Sensitivity When Comparing Two Characters Recipe 2.4 Finding All Occurrences of a Character Within a String... Introduction Recipe 17.1 Controlling Access to Types in a Local Assembly Recipe 17.2 Encrypting/Decrypting a String Recipe 17.3 Encrypting and Decrypting a File Recipe 17.4 Cleaning up Cryptography Information... Framework for them, and how to create custom implementations of collections using generics Chapter 5, Collections This chapter examines recipes that make use of collections The collection recipes make use ofas well as extend the

Ngày đăng: 25/03/2019, 16:43

Từ khóa liên quan

Mục lục

  • C# Cookbook, 2nd Edition

  • Table of Contents

  • Copyright

    • Dedication

    • Preface

      • Who This Book Is For

      • What You Need to Use This Book

      • Platform Notes

      • How This Book Is Organized

      • What Was Left Out

      • Conventions Used in This Book

      • About the Code

      • Using Code Examples

      • Comments and Questions

      • Safari Enabled

      • Acknowledgments

      • Chapter 1.  Numbers and Enumerations

        • Introduction

        • Recipe 1.1. Determining Approximate Equality Between a Fraction and Floating-Point Value

        • Recipe 1.2. Converting Degrees to Radians

        • Recipe 1.3. Converting Radians to Degrees

        • Recipe 1.4. Using the Bitwise Complement Operator with Various Data Types

        • Recipe 1.5. Testing for an Even or Odd Value

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan