Book description
Professional C# 2005 prepares you to program in C#, and it provides the necessary background information on how the .NET architecture works. It provides examples of applications that use a variety of related technologies, including database access, dynamic web pages, advanced graphics, and directory access. The only requirement is that you are familiar with at least one other high-level language used on Windows—either C++, VB, or J++.
It starts with a tutorial on C# and the .NET framework. This introduction assumes no prior knowledge of .NET, but it does move rapidly, on the assumption that the reader is an experienced programmer. Once this background knowledge is established, the book starts to sweep through the vast .NET class library, showing how you can use C# to solve various tasks. This comprehensive coverage is one of the key selling points of previous versions of the book, and is maintained and enhanced with this new edition by adding new chapters on Generics, ObjectSpaces, Yukon, and Indigo. Some reference material is included either as appendices or is available to download from the Wrox website.
After the introduction and initial chapter, the book is divided into a number of sections that cover both the C# language and its application in a variety of areas. Coverage includes:
Writing Windows applications and Windows services
Writing web pages and web services with ASP.NET
Manipulating XML using C# 2005
Understanding .NET Assemblies
Using ADO.NET to access databases
Integration with COM, COM+, and Active Directory
Distributed applications with .NET Remoting
Generating graphics using C# 2005
Accessing files and the Registry, and controlling .NET security
Table of contents
- Copyright
- About the Authors
- Credits
- Introduction
-
I. The C# Language
-
1. .NET Architecture
- 1.1. The Relationship of C# to .NET
- 1.2. The Common Language Runtime
- 1.3. A Closer Look at Intermediate Language
- 1.4. Assemblies
- 1.5. .NET Framework Classes
- 1.6. Namespaces
- 1.7. Creating .NET Applications Using C#
- 1.8. The Role of C# in the .NET Enterprise Architecture
- 1.9. Summary
-
2. C# Basics
- 2.1. Before We Start
- 2.2. Your First C# Program
- 2.3. Variables
- 2.4. Predefined Data Types
- 2.5. Flow Control
- 2.6. Enumerations
- 2.7. Arrays
- 2.8. Namespaces
- 2.9. The Main() Method
- 2.10. More on Compiling C# Files
- 2.11. Console I/O
- 2.12. Using Comments
- 2.13. The C# Preprocessor Directives
- 2.14. C# Programming Guidelines
- 2.15. Summary
- 3. Objects and Types
- 4. Inheritance
- 5. Operators and Casts
- 6. Delegates and Events
-
7. Memory Management and Pointers
- 7.1. Memory Management under the Hood
- 7.2. Freeing Unmanaged Resources
-
7.3. Unsafe Code
-
7.3.1. Pointers
- 7.3.1.1. Writing unsafe code
- 7.3.1.2. Pointer syntax
- 7.3.1.3. Casting pointers to integer types
- 7.3.1.4. Casting between pointer types
- 7.3.1.5. void pointers
- 7.3.1.6. Pointer arithmetic
- 7.3.1.7. The sizeof operator
- 7.3.1.8. Pointers to structs: The pointer member access operator
- 7.3.1.9. Pointers to class members
- 7.3.2. Pointer Example: PointerPlayaround
- 7.3.3. Using Pointers to Optimize Performance
-
7.3.1. Pointers
- 7.4. Summary
- 8. Strings and Regular Expressions
- 9. Collections
- 10. Generics
- 11. Reflection
-
12. Errors and Exceptions
-
12.1. Looking into Errors and Exception Handling
- 12.1.1. Exception Classes
- 12.1.2. Catching Exceptions
- 12.1.3. User-Defined Exception Classes
- 12.2. Summary
-
12.1. Looking into Errors and Exception Handling
- 13. Threading
-
1. .NET Architecture
-
II. The .NET Environment
- 14. Visual Studio 2005
-
15. Assemblies
- 15.1. What Are Assemblies?
- 15.2. Assembly Structure
- 15.3. Cross-Language Support
- 15.4. Global Assembly Cache
- 15.5. Creating Shared Assemblies
- 15.6. Configuration
- 15.7. Summary
-
16. .NET Security
- 16.1. Code Access Security
- 16.2. Support for Security in the Framework
-
16.3. Managing Security Policies
- 16.3.1. The Security Configuration File
- 16.3.2. Managing Code Groups and Permissions
- 16.3.3. Turning Security On and Off
- 16.3.4. Resetting Security Policy
- 16.3.5. Creating a Code Group
- 16.3.6. Deleting a Code Group
- 16.3.7. Changing a Code Group's Permissions
- 16.3.8. Creating and Applying Permissions Sets
- 16.3.9. Distributing Code Using a Strong Name
- 16.3.10. Distributing Code Using Certificates
- 16.3.11. Managing Zones
- 16.4. Role-Based Security
- 16.5. Summary
- 17. Localization
-
18. Deployment
- 18.1. Designing for Deployment
- 18.2. Deployment Options
- 18.3. Deployment Requirements
- 18.4. Simple Deployment
- 18.5. Installer Projects
- 18.6. ClickOnce
- 18.7. Summary
-
III. Data
-
19. Data Access with .NET
- 19.1. ADO.NET Overview
- 19.2. Using Database Connections
- 19.3. Commands
- 19.4. Fast Data Access: The Data Reader
- 19.5. Managing Data and Relationships: The DataSet Class
- 19.6. XML Schemas
- 19.7. Populating a DataSet
- 19.8. Persisting DataSet Changes
- 19.9. Working with ADO.NET
- 19.10. Summary
- 20. .NET Programming with SQL Server 2005
-
21. Manipulating XML
- 21.1. XML Standards Support in .NET
- 21.2. Introducing the System.Xml Namespace
- 21.3. Using MSXML in .NET
- 21.4. Using System.Xml Classes
- 21.5. Reading and Writing Streamed XML
- 21.6. Using the DOM in .NET
- 21.7. Using XPathNavigators
- 21.8. XML and ADO.NET
- 21.9. Serializing Objects in XML
- 21.10. Summary
-
22. Working with Active Directory
- 22.1. The Architecture of Active Directory
- 22.2. Administration Tools for Active Directory
-
22.3. Programming Active Directory
- 22.3.1. Classes in System.DirectoryServices
- 22.3.2. Binding
- 22.3.3. Getting Directory Entries
- 22.3.4. Object Collections
- 22.3.5. Cache
- 22.3.6. Creating New Objects
- 22.3.7. Updating Directory Entries
- 22.3.8. Accessing Native ADSI Objects
- 22.3.9. Searching in Active Directory
- 22.4. Searching for User Objects
- 22.5. DSML
- 22.6. Summary
-
19. Data Access with .NET
-
IV. Windows Applications
-
23. Windows Forms
- 23.1. Creating a Windows Form Application
- 23.2. Control Class
-
23.3. Standard Controls and Components
- 23.3.1. Button
- 23.3.2. CheckBox
- 23.3.3. RadioButton
- 23.3.4. ComboBox, ListBox, and CheckedListBox
- 23.3.5. DateTimePicker
- 23.3.6. ErrorProvider
- 23.3.7. HelpProvider
- 23.3.8. ImageList
- 23.3.9. Label
- 23.3.10. ListView
- 23.3.11. PictureBox
- 23.3.12. ProgressBar
- 23.3.13. TextBox, RichTextBox and MaskedTextBox
- 23.3.14. Panel
- 23.3.15. FlowLayoutPanel and TableLayoutPanel
- 23.3.16. SplitContainer
- 23.3.17. TabControl and TabPages
- 23.3.18. ToolStrip
- 23.3.19. MenuStrip
- 23.3.20. ContextMenuStrip
- 23.3.21. ToolStripMenuItem
- 23.3.22. ToolStripManager
- 23.3.23. ToolStripContainer
- 23.4. Forms
- 23.5. Summary
-
24. Viewing .NET Data
- 24.1. The DataGridView Control
- 24.2. DataGridView Class Hierarchy
- 24.3. Data Binding
- 24.4. Visual Studio .NET and Data Access
- 24.5. Summary
-
25. Graphics with GDI+
- 25.1. Understanding Drawing Principles
- 25.2. Measuring Coordinates and Areas
- 25.3. A Note about Debugging
- 25.4. Drawing Scrollable Windows
- 25.5. World, Page, and Device Coordinates
- 25.6. Colors
- 25.7. Pens and Brushes
- 25.8. Drawing Shapes and Lines
- 25.9. Displaying Images
- 25.10. Issues When Manipulating Images
- 25.11. Drawing Text
- 25.12. Simple Text Example
- 25.13. Fonts and Font Families
- 25.14. Example: Enumerating Font Families
- 25.15. Editing a Text Document: The CapsEditor Sample
- 25.16. Printing
- 25.17. Summary
-
23. Windows Forms
-
V. Web Applications
-
26. ASP.NET Pages
- 26.1. ASP.NET Introduction
- 26.2. ASP.NET Web Forms
- 26.3. ADO.NET and Data Binding
- 26.4. Application Configuration
- 26.5. Summary
- 27. ASP.NET Development
-
26. ASP.NET Pages
-
VI. Communication
- 28. Web Services
-
29. .NET Remoting
- 29.1. What Is .NET Remoting?
- 29.2. .NET Remoting Overview
- 29.3. Contexts
- 29.4. Remote Objects, Clients, and Servers
- 29.5. .NET Remoting Architecture
-
29.6. Miscellaneous .NET Remoting Features
-
29.6.1. Configuration Files
- 29.6.1.1. Predefined channels
- 29.6.1.2. Server configuration for well-known objects
- 29.6.1.3. Client configuration for well-known objects
- 29.6.1.4. Server configuration for client-activated objects
- 29.6.1.5. Client configuration for client-activated objects
- 29.6.1.6. Server code using configuration files
- 29.6.1.7. Client code using configuration files
- 29.6.1.8. Delayed loading of client channels
- 29.6.1.9. Debugging Configuration
- 29.6.1.10. Lifetime services in configuration files
- 29.6.1.11. Formatter providers
- 29.6.1.12. .NET Framework Configuration tool
- 29.6.2. Hosting Servers in ASP.NET
- 29.6.3. Classes, Interfaces, and Soapsuds
- 29.6.4. Asynchronous Remoting
- 29.6.5. Security with .NET Remoting
- 29.6.6. Remoting and Events
- 29.6.7. Call Contexts
-
29.6.1. Configuration Files
- 29.7. Summary
- 30. Enterprise Services
-
31. Message Queuing
- 31.1. Overview
- 31.2. Message Queuing Products
- 31.3. Message Queuing Architecture
- 31.4. Message Queuing Administrative Tools
- 31.5. Programming Message Queuing
- 31.6. Course Order Application
- 31.7. Receiving Results
- 31.8. Transactional Queues
- 31.9. Message Queue Installation
- 31.10. Summary
- 32. Future of Distributed Programming
-
VII. Interop
-
33. COM Interoperability
- 33.1. .NET and COM
- 33.2. Marshaling
- 33.3. Using a COM Component from a .NET Client
-
33.4. Using a .NET Component from a COM Client
- 33.4.1. COM Callable Wrapper
- 33.4.2. Creating a .NET Component
- 33.4.3. Creating a Type Library
- 33.4.4. COM Interop Attributes
- 33.4.5. COM Registration
- 33.4.6. Creating a COM Client
- 33.4.7. Adding Connection Points
- 33.4.8. Creating a Client with a Sink Object
- 33.4.9. Running Windows Forms Controls in Internet Explorer
- 33.5. Summary
-
33. COM Interoperability
-
VIII. Windows Base Services
-
34. Manipulating Files and the Registry
- 34.1. Managing the File System
- 34.2. Moving, Copying, and Deleting Files
- 34.3. Reading and Writing to Files
- 34.4. Reading Drive Information
- 34.5. File Security
- 34.6. Reading and Writing to the Registry
- 34.7. Summary
-
35. Accessing the Internet
- 35.1. The WebClient Class
- 35.2. WebRequest and WebResponse Classes
-
35.3. Displaying Output as an HTML Page
- 35.3.1. Allowing Simple Web Browsing from Your Applications
- 35.3.2. Launching Internet Explorer Instances
- 35.3.3. Giving Your Application More IE Type Features
- 35.3.4. Showing Documents using the WebBrowser Control
- 35.3.5. Printing using the WebBrowser Control
- 35.3.6. Displaying the Code of a Requested Page
- 35.3.7. The Web Request and Web Response Hierarchy
- 35.4. Utility Classes
- 35.5. Lower-Level Protocols
- 35.6. Summary
-
36. Windows Services
- 36.1. What Is a Windows Service?
- 36.2. Windows Services Architecture
- 36.3. System.ServiceProcess Namespace
- 36.4. Creating a Windows Service
- 36.5. Monitoring and Controlling the Service
- 36.6. Troubleshooting
- 36.7. Power Events
- 36.8. Summary
-
34. Manipulating Files and the Registry
-
IX. Appendices
-
A. Principles of Object-Oriented Programming
- A.1. A Note for Visual Basic 6 Programmers
- A.2. What Is an Object?
- A.3. Objects in Programming
- A.4. Introducing Inheritance
- A.5. Interfaces
- A.6. Construction and Disposal
- A.7. Summary
-
B. C# for Visual Basic 6 Developers
-
B.1. Differences Between C# and Visual Basic
- B.1.1. Classes
- B.1.2. Compilation
- B.1.3. The .NET Base Classes
- B.1.4. Conventions
- B.1.5. Example: The Square Root Form
- B.1.6. SquareRoot Visual Basic Version
- B.1.7. SquareRoot C# Version
- B.1.8. Basic Syntax
- B.1.9. Methods
- B.1.10. Variables
- B.1.11. Classes
- B.1.12. If Statements
- B.1.13. Extra Code in C#
- B.1.14. What Happens When You Run a Program
- B.1.15. The C# Code for the Rest of the Program
- B.1.16. Program Entry Point
- B.1.17. Instantiating Classes
- B.1.18. The SquareRootForm Class
-
B.2. Example: Employees and Managers
- B.2.1. The Visual Basic Employee Class Module
- B.2.2. Static Members
- B.2.3. Inheritance
- B.2.4. Inheriting from the Employee Class
- B.2.5. The Manager Class
- B.2.6. Method Overrides
- B.2.7. The Manager Constructors
- B.2.8. Method Overloading
- B.2.9. Using the Employee and Manager Classes
- B.2.10. References to Derived Classes
- B.3. Arrays of Objects
- B.4. The for Loop
- B.5. Other C# Features
- B.6. Summary
-
B.1. Differences Between C# and Visual Basic
-
C. C# for Java Developers
- C.1. Starting Out
- C.2. Declaring Variables
- C.3. Variable Naming Conventions
- C.4. Data Types
- C.5. Operators
- C.6. Flow Control and Iteration
- C.7. Classes
- C.8. Input and Output
- C.9. Summary
-
D. C# for C++ Developers
- D.1. Conventions for This Appendix
- D.2. Terminology
- D.3. A Comparison of C# and C++
- D.4. The Hello World Example
-
D.5. Topic-by-Topic Comparison
- D.5.1. Program Architecture
- D.5.2. Language Syntax
- D.5.3. Program Flow
- D.5.4. Variables
- D.5.5. Memory Management
- D.5.6. Methods
- D.5.7. Properties
- D.5.8. Operators
- D.5.9. Classes and Structs
- D.5.10. Classes
- D.5.11. Structs
- D.5.12. Constants
- D.5.13. Operator Overloading
- D.5.14. Arrays
- D.5.15. Enumerations
- D.5.16. Exceptions
- D.5.17. Pointers and Unsafe Code
- D.5.18. Interfaces
- D.5.19. Delegates
- D.5.20. Events
- D.5.21. Attributes
- D.5.22. Templates and Generics
- D.5.23. Preprocessor Directives
- D.6. Summary
-
A. Principles of Object-Oriented Programming
Product information
- Title: Professional C# 2005
- Author(s):
- Release date: November 2005
- Publisher(s): Wrox
- ISBN: 9780764575341
You might also like
book
Professional C# 2008
Professional C# 2008 starts by reviewing the overall architecture of .NET in Chapter 1 in order …
book
Working with Microsoft® Visual Studio® 2005
This book is a hands-on guide to customizing and adapting Microsoft Visual Studio 2005 to best …
book
Beginning Visual C#® 2005
Creating next-generation software and applications is now easier than ever with the release of Visual C# …
book
Visual Studio® 2010 and .NET 4, Six-in-one
Complete coverage of all key .NET 4 and Visual Studio 2010 languages and technologies .NET 4 …