Application Development Using C# and .NET

Application Development Using C# and .NET

Read it now on the O’Reilly learning platform with a 10-day free trial.

O’Reilly members get unlimited access to books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.

Book description

Build industrial-strength .NET applications with C#!

This book gives experienced developers all the practical insight they need to build enterprise applications for Microsoft's .NET platform using C#. Using extensive code examples and a running case study, the authors illuminate the .NET concepts and technologies that offer the greatest power and value. They cover the entire process of constructing a .NET application: creating a monolithic C# console application; enhancing it with a Windows Forms interface; isolating functionality inside components, adding database access and security; and finally, delivering functionality through ASP.NET and Web Services.

Part of The Integrated .NET series from Object Innovations.

Show and hide more Table of contents Product information

Table of contents

  1. Copyright
    1. Dedication
    1. Organization
    2. Sample Programs
    3. Caveat
    4. Web Sites
    1. Introduction
    2. Introductory .NET Language Books
    3. Introduction to C# Using .NET
    4. Introduction to Programming Visual Basic Using .NET
    5. Programming Perl in the .NET Environment
    6. Intermediate .NET Framework Books
    7. Application Development Using C# and .NET
    8. Application Development Using Visual Basic .NET
    9. .NET Architecture and Programming Using Visual C++
    10. Fundamentals of Web Applications Using .NET and XML
    1. Microsoft and the Web
      1. Applications in the Internet Age
      2. Web Services
      3. ASP.NET
      4. Open Standards and Interoperability
      5. Communications Protocols
      1. Problems with Windows
      2. The Glass House and Thin Clients
      3. A Robust Windows
      1. .NET Framework
      2. Common Language Runtime
        1. Managed Code and Data
        2. Verifiable Code
        1. Success Factors for Web Services
        1. Problems of Windows Development
        2. Applications of the Future
        3. .NET Overview
          1. The Magic of Metadata
          2. .NET Framework Class Library
          3. Interface-Based Programming
          4. Everything Is an Object
          5. Common Type System
          6. ILDASM
          7. Language Interoperability
          8. Managed Code
          9. Assemblies
          10. JIT Compilation
          11. Performance
          1. Hello World in C#
            1. Compiling and Running (Command Line)
            2. Program Structure
            3. Namespaces
            1. Variables
            2. Literals
            3. C# Operators and Expressions
            4. Output and Formatting
              1. Placeholders
              2. Format Strings
              3. Sample Formatting Code
              1. Switch Statement
              1. Using the InputWrapper Class
              2. Compiling Multiple Files
              3. InputWrapper Class Implementation
              1. Classes as Structured Data
                1. Classes and Objects
                2. References
                3. Constructors
                4. Default Constructor
                5. Instantiating and Using an Object
                6. Assigning Object References
                7. Garbage Collection
                1. Public and Private
                2. This
                3. Sample Program
                1. Static Methods
                2. Sample Program
                1. Overview of Types in C#
                  1. Value Types
                  2. Reference Types
                  3. Pointer Types
                  1. Simple Types
                  2. Types in System Namespace
                  3. Structures
                  4. Enumeration Types
                  1. Class Types
                  2. Object
                  3. String
                  1. Characters
                    1. ASCII and Unicode
                    2. Escape Sequences
                    1. String Literals and Initialization
                    2. Concatenation
                    3. Index
                    4. Relational Operators
                    1. Length
                    2. ToUpper
                    3. ToLower
                    4. Substring
                    5. IndexOf
                    1. Arrays
                      1. One-Dimensional Arrays
                      1. Constructors
                      2. Next Methods
                      3. NextDouble Method
                      1. Parameter Passing
                      2. Value Parameters
                      3. Reference Parameters
                      4. Output Parameters
                      5. Method Overloading
                        1. Modifiers as Part of the Signature
                        1. Exception Fundamentals
                          1. .NET Exception Handling
                          2. Exception Flow of Control
                          3. Context and Stack Unwinding
                          4. Example Program
                          5. System.Exception
                          1. Finally Block
                          1. Unsafe Blocks
                          2. Pointers
                          3. Fixed Memory
                          1. Review of Object-Oriented Concepts
                            1. Objects
                              1. Objects in the Real World
                              2. Object Models
                              3. Reusable Software Components
                              4. Objects in Software
                              5. Abstraction
                              6. Encapsulation
                              1. Inheritance
                              2. Abstract Classes
                              3. Relationships Among Classes
                              1. Designing the Abstractions
                                1. Reservable
                                2. Reservation
                                3. Broker
                                4. ReservationResult
                                1. Reserve
                                2. Lists of Reservations and Reservables
                                1. Inheritance Fundamentals
                                  1. C# Inheritance Syntax
                                  2. Changing the Interface to Existing Members
                                  3. Invoking Base Class Constructors
                                  1. Class Accessibility
                                    1. Public
                                    2. Internal
                                    1. Public
                                    2. Private
                                    3. Protected
                                    4. Internal
                                    5. Internal Protected
                                    1. Running the Case Study
                                    2. HotelReservation
                                    3. HotelBroker
                                    4. Customers
                                    5. Namespace
                                    6. TestHotel
                                    1. Employee Class Hierarchy
                                    2. Method Hiding
                                    3. Static Binding
                                      1. Type Conversions in Inheritance
                                      1. Virtual Methods and Efficiency
                                      2. Method Overriding
                                      1. System.Object
                                        1. Public Instance Methods of object
                                          1. Equals
                                          2. ToString
                                          3. GetHashCode
                                          4. GetType
                                          1. MemberWiseClone
                                          2. Finalize
                                          1. Default Methods of Object
                                          2. Overriding Methods of Object
                                          1. ArrayList Example
                                            1. Customers Class
                                            1. Interface Fundamentals
                                              1. Interfaces in C#
                                              2. Implementing an Interface
                                              3. Using an Interface
                                              1. Interface Inheritance
                                              2. Implementing Multiple Interfaces
                                              3. Using Multiple Interfaces
                                              1. As Operator
                                              2. Is Operator
                                              1. The Contracts
                                                1. Customer Contract
                                                2. Hotel Contracts
                                                1. Structures
                                                1. Collection Interfaces
                                                  1. Interface Documentation
                                                  2. IEnumerable And IEnumerator
                                                  3. ICollection
                                                  4. IList
                                                  1. Shallow Copy and Deep Copy
                                                  2. Example Program
                                                  3. Reference Copy by Assignment
                                                  4. Memberwise Clone
                                                  5. Using ICloneable
                                                  1. Sorting an Array
                                                  2. Implementing IComparable
                                                  1. Declaring a Delegate
                                                  2. Defining a Method
                                                  3. Creating a Delegate Object
                                                  4. Calling a Delegate
                                                  5. Combining Delegate Objects
                                                  6. Complete Example
                                                  7. Stock Market Simulation
                                                    1. Running the Simulation
                                                    2. Delegate Code
                                                    3. Passing the Delegates to the Engine
                                                    4. Random-Number Generation
                                                    5. Using the Delegates
                                                    6. Events
                                                    1. Client Code
                                                    2. Server Code
                                                    1. Attributes in .NET
                                                      1. Preprocessor Symbols Using Compiler Option
                                                      2. Using Attributes
                                                      3. Attribute Targets
                                                      1. Windows Forms Hierarchy
                                                      2. Simple Forms Using .NET SDK
                                                        1. Step 0:. A Simple Form
                                                          1. Windows Messages
                                                          1. Windows Forms Event Handling
                                                          1. HAndling Left and Right Buttons
                                                          2. KeyPress Event
                                                          1. Step 4:. A Menu to Exit the Program
                                                          2. Menu Code
                                                          3. Menu Event Code
                                                          1. Step 5:. Using a TextBox Control
                                                          1. Windows Forms Demonstration
                                                          2. Design Window and Code Window
                                                          3. Adding an Event
                                                          4. Code for Event Handler
                                                          5. Using the Menu Control
                                                          6. Closing a Form
                                                          1. .NET Dialog Documentation
                                                          2. Dialog Box Demonstration
                                                            1. Creating a Modal Dialog
                                                            2. Passing Information Between Parent Form and a Dialog
                                                            1. Populating a ListBox
                                                            2. Selecting an Item From a ListBox
                                                            1. Assemblies
                                                              1. Contents of an Assembly
                                                              2. Versioning an Assembly
                                                              3. Strong Names
                                                              4. Digital Signatures
                                                              5. Digitally Signing an Assembly
                                                              1. Deploying a Shared Assembly
                                                              2. Versioning Shared Components
                                                              1. Resolving an Assembly Reference at Runtime
                                                              2. Specifying the Version Policy in a Configuration File
                                                              3. Finding the Assembly’s Physical Location
                                                              4. Assembly Location and Visual Studio.NET
                                                              1. CAB Project
                                                              2. Setup Project
                                                              3. Merge Module Project
                                                              4. Web-based Deployment
                                                              1. Metadata and Reflection
                                                                1. Type
                                                                2. Late Binding
                                                                1. Streams
                                                                2. Primitive Datatypes and Streams
                                                                3. TextReader and TextWriter
                                                                4. File Manipulation
                                                                  1. File Class
                                                                  2. Path Class
                                                                  3. FileInfo Class
                                                                  4. File Example
                                                                  1. Serialization Objects
                                                                  2. ISerializable
                                                                  1. Threads
                                                                    1. Thread Synchronization
                                                                    2. Synchronization with Monitors
                                                                    3. Notification with Monitors
                                                                    4. Synchronization Classes
                                                                    5. Automatic Synchronization
                                                                    1. Proxies and Stubs
                                                                    2. ContextBoundObject
                                                                    1. Application Domain
                                                                    2. Application Domains and Assemblies
                                                                    3. AppDomain Class
                                                                    4. App Domain Events
                                                                    5. AppDomain Example
                                                                    6. Marshaling, AppDomains, and Contexts
                                                                    1. The Asynchronous Design Pattern
                                                                    2. IAsyncResult
                                                                    3. Using Delegates for Asynchronous Programming
                                                                      1. Begin/End Invoke
                                                                      2. Asynchronous Callback
                                                                      1. Remoting Overview
                                                                        1. Interception
                                                                        2. Channels And Formatters
                                                                        1. Sample Remoting Program
                                                                        1. Using a Custom Attribute
                                                                        2. Defining an Attribute Class
                                                                        3. Defining a Base Class
                                                                        1. Finalize
                                                                          1. C# Destructor Notation
                                                                          2. Limitations of Finalization
                                                                          1. Alternate Name for Dispose
                                                                          1. Generations
                                                                          1. SuppressFinalize
                                                                          2. Collect
                                                                          3. MaxGeneration
                                                                          4. GetGeneration
                                                                          5. GetTotalMemory
                                                                          1. .NET Data Providers
                                                                          2. The Visual Studio.NET Server Explorer
                                                                          3. Data Readers
                                                                            1. The Connected Database Scenario
                                                                            2. Executing SQL Statements
                                                                            3. DataReader
                                                                            4. Multiple Result Sets
                                                                            1. Disconnected Mode
                                                                            1. Updating the Data Source
                                                                            2. Auto Generated Command Properties
                                                                            1. Multiple Tables in a DataSet
                                                                            2. Table Creation without a Data Source
                                                                            3. Constraints and Relations
                                                                              1. Primary Keys
                                                                              2. Constraints
                                                                              3. Data Relations
                                                                              1. Navigating Relationships
                                                                              1. BeginEdit, EndEdit, CancelEdit
                                                                              2. DataRow Versions
                                                                              3. DataRow RowState Property
                                                                              4. Accepting and Rejecting Changes
                                                                              5. DataRow Errors
                                                                              1. XML Schema and Data
                                                                              2. XmlDataDocument
                                                                              3. DataSet and XML
                                                                              1. DataSet and XML
                                                                              2. Creating an XML Doc from a Dataset
                                                                              1. Generating Typed DataSets
                                                                              2. Fetching Data with a Typed DataSet
                                                                              3. Displaying Data with a Typed Dataset
                                                                              4. Modify Data with a Typed Dataset
                                                                              1. What Is ASP.NET?
                                                                                1. Web Application Fundamentals
                                                                                  1. Setting up the Web Examples
                                                                                  1. Compiled Code
                                                                                  2. Server Controls
                                                                                  3. Browser Independence
                                                                                  4. Separation of Code and Content
                                                                                  5. State Management
                                                                                  1. Page Class
                                                                                    1. Inheriting from Page Class
                                                                                    1. Page Events
                                                                                    2. Page Properties
                                                                                    3. Sample Program
                                                                                    1. Src
                                                                                    2. Language
                                                                                    3. Inherits
                                                                                    4. Debug
                                                                                    5. ErrorPage
                                                                                    6. Trace
                                                                                    1. HttpRequest Class
                                                                                      1. Collections
                                                                                      2. Example Program
                                                                                      1. Redirect
                                                                                      1. Hotel Information Web Page (Step 0)
                                                                                        1. Configuring Web Server Connection
                                                                                        2. Creating an ASP.NET Web Application
                                                                                        3. Using the Form Designer
                                                                                        4. Initializing the HotelBroker
                                                                                        5. Data Binding
                                                                                        6. Initializing the Hotels
                                                                                        7. Selecting a City
                                                                                        8. AutoPostBack
                                                                                        9. Debugging
                                                                                        1. Using Project | Copy Project.
                                                                                        2. Precompiled Web Page
                                                                                        3. Inherits Attribute in Page Directive
                                                                                        4. Configuring a Virtual Directory as an Application
                                                                                        5. Moving a Visual Studio ASP.NET Web Application Project
                                                                                        1. Configuring the Case Study
                                                                                        2. Acme Web Site Step 1
                                                                                          1. HotelReservations.Aspx
                                                                                          2. ManageReservations.Aspx
                                                                                          1. AcmeLib Component
                                                                                          2. Login.Aspx
                                                                                          3. RegisterNewUser.Aspx
                                                                                          4. Main.Aspx
                                                                                          1. Sessions
                                                                                          2. Global.asax
                                                                                          1. Static Data Members
                                                                                          2. Application Object
                                                                                          3. Session Object
                                                                                            1. Session State and Cookies
                                                                                            2. Session State Timeout
                                                                                            3. Session State Store
                                                                                            1. Configuration Files
                                                                                              1. Server Configuration File
                                                                                              2. Application Configuration Files
                                                                                              3. Configuration File Format
                                                                                              1. Web Controls
                                                                                              1. Html Controls Example
                                                                                              2. HTML Controls in Visual Studio
                                                                                              3. Validation Controls
                                                                                                1. Required Field Validation
                                                                                                2. Regular Expression Validation
                                                                                                1. Data Binding in ASP.NET
                                                                                                  1. Binding to an Arraylist
                                                                                                  2. Binding to a Datatable
                                                                                                  1. AcmeCustomerDatabase
                                                                                                  2. AcmeLibDb Component
                                                                                                  3. Acme Web Site (Step 3)
                                                                                                  1. Protocols
                                                                                                    1. XML
                                                                                                    2. XML Namespaces
                                                                                                    3. XML Schema
                                                                                                    4. SOAP
                                                                                                    5. WSDL
                                                                                                    1. The Add Web Service Example
                                                                                                    2. A Client Program for the Add Web Service
                                                                                                    3. WSDL
                                                                                                    4. Proxy Classes
                                                                                                    5. Web Service Client with Raw SOAP and HTTP
                                                                                                    1. Customer Web Service
                                                                                                    2. Hotel Broker Web Service
                                                                                                    3. Design Considerations
                                                                                                    1. User-Based Security
                                                                                                    2. Code Access Security
                                                                                                      1. Security Policy
                                                                                                      2. Permissions
                                                                                                      1. Internet Information Server
                                                                                                      1. Principals and Identities
                                                                                                      2. .NET Windows Roles
                                                                                                      3. Other Identity Classes
                                                                                                      4. ASP.NET Roles
                                                                                                      5. Operating System Identity and CLR Identity
                                                                                                        1. Unauthenticated Users
                                                                                                        2. Authenticated Users
                                                                                                        3. Problems with Impersonation
                                                                                                        1. Forms Authentication and Authorization
                                                                                                        2. Database Login Validation
                                                                                                        1. Simple Permission Code Request
                                                                                                        2. How a Permission Request Works
                                                                                                        3. Strategy for Requesting Permissions
                                                                                                        4. Denying Permissions
                                                                                                        5. Asserting Permissions
                                                                                                        6. Other Permission Methods
                                                                                                        7. SecurityPermission Class
                                                                                                        8. Unmanaged Code
                                                                                                        9. Attribute-Based Permissions
                                                                                                        10. Principal Permission
                                                                                                        11. PermissionSet
                                                                                                        1. Identity Permission Classes
                                                                                                        2. Evidence
                                                                                                        1. Security Policy Levels
                                                                                                        2. Code Groups
                                                                                                        3. Named Permission Sets
                                                                                                        4. Altering Security Policy
                                                                                                        1. The TraceDemo Example
                                                                                                        2. Enabling Debug and Trace Output
                                                                                                        3. Using the Debug and Trace Classes
                                                                                                        4. Using Switches to Enable Diagnostics
                                                                                                        5. Enabling or Disabling Switches
                                                                                                          1. Configuration File Switch Settings
                                                                                                          2. Programmatic Switch Settings
                                                                                                          3. Using Switches to Control Output
                                                                                                          1. Calling COM Components from Managed Code
                                                                                                            1. The Tlbimp.exe Utility
                                                                                                            2. Demonstration: Wrapping a Legacy COM Server
                                                                                                              1. Register the COM Server
                                                                                                              2. Run the COM Client
                                                                                                              3. Import the Type Library (TlbImp.exe)
                                                                                                              4. Implement the .NET Client Program
                                                                                                              5. Import a Type Library Using Visual Studio
                                                                                                              1. Dual Interfaces
                                                                                                              2. Pure Vtable Interface
                                                                                                              1. A Late Binding COM Client
                                                                                                              1. A Simple Example
                                                                                                              2. Marshaling out Parameters
                                                                                                                1. Translating Types
                                                                                                                1. Overview of Visual Studio.NET
                                                                                                                  1. Toolbars
                                                                                                                    1. Customizing a Toolbar
                                                                                                                    1. Creating a C# Project
                                                                                                                    2. Adding a C# File
                                                                                                                    3. Using the Visual Studio Text Editor
                                                                                                                    4. Building the Project
                                                                                                                    5. Running the Program
                                                                                                                    6. Running the Program in the Debugger
                                                                                                                    1. Creating a New Configuration
                                                                                                                    2. Setting Build Settings for a Configuration
                                                                                                                    1. Just-in-Time Debugging
                                                                                                                    2. Standard Debugging
                                                                                                                      1. Breakpoints
                                                                                                                      2. Watching Variables
                                                                                                                      3. Debugger Options
                                                                                                                      4. Single Stepping
                                                                                                                      Show and hide more

                                                                                                                      Product information

                                                                                                                      • Title: Application Development Using C# and .NET
                                                                                                                      • Author(s): Michael Stiefel, Robert J. Oberg
                                                                                                                      • Release date: December 2001
                                                                                                                      • Publisher(s): Pearson
                                                                                                                      • ISBN: 013093383X