C# occupies a central position in the initial version of Microsoft.net. It is the latest object-oriented programming language developed by Microsoft. It combines the power of C++ with the ease of use of Visual Basic. This book is divided into three parts to help readers learn the C# language. The first part provides a comprehensive discussion of the C# language, describing the keywords, statements, and features defined in the C# language. I/O, file processing, mapping, and preprocessing procedures are also introduced. Part 2 discusses the C# class library, which is also . NET framework class library. Due to limited space, this book focuses on the core class libraries contained in the system namespace. This part of the content is used by almost every C# programmer. Part 3 includes examples of C# applications.
The content of this book is from shallow to deep, and has a wide range of applications. It is also suitable for readers with no programming experience and programmers with a certain foundation in C++ or Java.
The directory is as follows:
Part 1 C# language
Chapter 1 The Origin of C#
1.1 History of C# Development
1.2 How C# relates to the .NET Framework
1.3 How the Universal Language Runtime works
1.4 Manageable code and unmanageable code
Chapter 2 C# Overview
2.1 Object-oriented programming
2.2 The first simple program
2.3 Handling syntax errors
2.4 A small improvement
2.5 The second simple program
2.6 Another data type
2.7 Two control statements
2.8 Using code blocks
2.9 Semicolon and positioning
2.10 Indentation
2.11 Identifiers
2.12 C# class library
Chapter 3 Data Types, Literals and Variables
3.1 Importance of data types
3.2 Numeric types in C#
3.3 Integer types
3.4 Floating point types
3.5 decimal type
3.6 characters
3.7 bool type
3.8 Some output options
3.9 Direct quantity
3.10 Variables
3.11 Scope and usage period of variables
3.12 Type conversion and coercion
3.13 Type conversion in expressions
Chapter 4 Operators
4.1 Arithmetic operators
4.2 Relational operators and logical operators
4.3 Assignment operator
4.4 Bit Operators
4.5? operator
4.6 Spacing and brackets
4.7 Operator precedence
Chapter 5 Program Control Statements
5.1 if statement
5.2 switch statement
5.3 for loop
5.4 while loop
5.5 do-while loop
5.6 foreach loop
5.7 Use the break statement to exit the loop
5.8 continue statement
5.9 goto statement
Chapter 6 Classes, Objects, and Methods
6.1 Class Basics
6.2 How to create objects
6.3 Reference variables and assignment
6.4 Methods
6.5 Constructor
6.6 new operator
6.7 Garbage collection and destructors
6.8 this keyword
Chapter 7 Arrays and Strings
7.1 Array
7.2 Multidimensional arrays
7.3 Non-integrated arrays
7.4 Allocating array references
7.5 Length attribute
7.6 foreach loop
7.7 String
Chapter 8 Methods and Classes
8.1 Controlling access to class members
8.2 Passing objects to methods
8.3 ref parameters and out parameters
8.4 The number of arguments is variable
8.5 Return object
8.6 Method overloading
8.7 Overloading constructors
8.8 Main() method
8.9 Recursion
8.10 static keyword
Chapter 9 Operator Overloading
9.1 Basics of operator overloading
9.2 Handling operations on C# internal types
9.3 Overloading relational operators
9.4 Overloading true and false
9.5 Overloading logical operators
9.6 Conversion operators
9.7 Operator overloading tips and limitations
9.8 Another example of operator overloading
Chapter 10 Indexes and Properties
10.1 Index
10.2 Properties
10.3 Using indexes and properties
Chapter 11 Inheritance
11.1 Inheritance basics
11.2 Member access and inheritance
11.3 Constructors and inheritance
11.4 Inheritance and name hiding
11.5 Creating multi-level hierarchies
11.6 When to call constructors
11.7 Base class references and derived objects
11.8 Virtual methods and overloading
11.9 Using abstract classes
11.10 Use sealed to prevent inheritance
11.11 object class
Chapter 12 Interfaces, Structures, and Enumerations
12.1 Interface
12.2 Using interface references
12.3 Interface properties
12.4 Interface index
12.5 Interfaces can be inherited
12.6 Interface inheritance causes name hiding
12.7 Explicit implementation
12.8 Choosing between interfaces and abstract classes
12.9 .NET standard interface
12.10 Example study of interfaces
12.11 Structure
12.12 Enumerations
Chapter 13 Exception Handling
13.1 System.Exception class
13.2 Basics of exception handling
13.3 Consequences of Uncaught Exceptions
13.4 Exceptions allow reasonable error handling
13.5 Using multiple catch statements
13.6 Catching all exceptions
13.7 Nested try modules
13.8 Throwing exceptions
13.9 finally statement
13.10 Detailed analysis of exceptions
13.11 Derived exception classes
13.12 Catching derived class exceptions
13.13 checked statements and unchecked statements
Chapter 14 Input and Output
14.1 C#’s I/O relies on data streams
14.2 Data flow class
14.3 Console I/O
14.4 File data streams and byte-oriented file I/O
14.5 Character-based file I/O
14.6 Redirecting standard data streams
14.7 Reading and writing binary data
14.8 Random access files
14.9 MemoryStream class
14.10 StringReader class and StringWriter class
14.11 Convert a numeric string to its internal representation
Chapter 15 Agents and Events
15.1 Agent
15.2 Events
15.3 .NET event principles
15.4 Application Events: Case Study
Chapter 16 Namespaces, Preprocessors, and Assemblies
16.1 Namespaces
16.2 Preprocessor
16.3 Assembly and internal access modifiers
Chapter 17 Runtime Type IDs, Mappings, and Properties
17.1 Runtime type identification
17.2 Mapping
17.3 Using mappings
17.4 Properties
17.5 Using built-in properties
Chapter 18 Unsafe Code, Pointers, and Other Topics
18.1 Unsafe Code
18.2 Other keywords
18.3 const and volatile
Part 2 C# Class Library
Chapter 19 System Namespace
19.1 Members of System
19.2 Math class
19.3 Structure of numeric types
19.4 Array class
19.5 BitConverter Class
19.6 Use Random to generate random numbers
19.7 Memory management and GC classes
19.8 Object class
19.9 IComparable interface
19.10 IConvertible interface
19.11 ICloneable interface
19.12 IFormatProvider interface and IFormattable interface
Chapter 20 Strings and Formatting
20.1 Strings in C#
20.2 String class
20.3 Formatting
20.4 Formatting data using String.Format() and ToString()
20.5 Creating custom number formats
20.6 Format date and time
20.7 Formatting enumerations
Chapter 21 Multithreaded Programming
21.1 Multithreading Basics
21.2 Thread class
21.3 Determine thread end time
21.4 IsBackground Property
21.5 Thread Priority
21.6 Synchronization
21.7 Thread communication using Wait(), Pulse(), and PulseAll()
21.8 MethodImplAttribute attribute
21.9 Suspend, Resume, and Stop Threads
21.10 Determining thread status
21.11 Using the main thread
21.12 Multithreading Tips
21.13 Start independent tasks
Chapter 22 Gathering
22.1 Overview of collections
22.2 Collection interface
22.3 DictionaryEntry structure
22.4 General Collection Class
22.5 Using BitArray to store bits
22.6 Private Collections
22.7 Accessing collections via counters
22.8 Storing user-defined classes in collections
22.9 Summary
Chapter 23 Networking via the Internet
23.1 Members of System.Net
23.2 Uniform Resource Identifier
23.3 Basics of Internet access
23.4 Handling network errors
23.5 Uri class
23.6 Access additional HTTP response information
23.7 MiniCrawler: Case Study
23.8 Using WebClient
The third part applies C#
Chapter 24 Building Components
24.1 The concept of components
24.2 Concept of C# components
24.3 IComponent interface
24.4 Component class
24.5 A simple component
24.6 Overloading Dispose()
24.7 Using the using statement
24.8 Containers
24.9 Components are the future of programming
Chapter 25 Creating Forms-Based Windows Applications
25.1 A brief history of Windows programming
25.2 Two Ways to Write Forms-Based Windows Applications
25.3 Methods for Windows to interact with users
25.4 Windows Forms
25.5 Form-based Windows framework programs
25.6 Adding buttons
25.7 Message processing
25.8 Using message boxes
25.9 Adding a menu
25.10 Summary
Chapter 26 Recursive Expression Analyzer
26.1 Expressions
26.2 Analyzing Expressions: Problems
26.3 Analyzing expressions
26.4 Analyzing expressions
26.5 A simple expression parser
26.6 Adding variables to the analyzer
26.7 Syntax checking in recursive parsers
26.8 Some attempts
Appendix A XML Comments Quick Reference Appendix BC# and Robotics
Expand