Learning c sharp 2005, 2nd edition (2006)

1K 46 0
Learning c sharp 2005, 2nd edition (2006)

Đ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

Learning C# 2005 By Jesse Liberty, Brian MacDonald Publisher: O'Reilly Pub Date: February 2006 Print ISBN-10: 0-596-10209-7 Print ISBN-13: 978-0-59-610209-8 Pages: 552 Table of Contents | Index If you're a novice programmer and you want to learn C#, there aren't many books that will guide you Most C# books are written for experienced C++ and Java programmers That's why Jesse Liberty, author of the best-selling books Programming C# and Programming ASP.NET, has written an entry-level guide to C# Written in a warm and friendly manner, Learning C# assumes no prior programming experience, and provides a thorough introduction to Microsoft's premier NET language The book helps you build a solid foundation in NET, and shows you how to apply your skills through the use of dozens of tested examples You'll learn about the syntax and structure of the C# language, including operators, classes and interfaces, structs, arrays, and strings Better yet, this updated edition of Learning C# has been completely revised to include the very latest content and teaching techniques Here's what's new: A detailed explanation of C# 2.0 An introduction to Visual Studio 2005, a tool set for building Windows and web applications More than 200 questions and programming exercises to help you better judge your understanding of the material A greater emphasis on event handling Information on generics and generic collections By the time you've finished Learning C#, you'll be ready to move on to a more advanced programming guide that will help you create large-scale web and Windows applications Whether you have a little object-oriented programming experience or you are new to programming altogether, Learning C# will set you firmly on your way to mastering the essentials of the C# language Learning C# 2005 By Jesse Liberty, Brian MacDonald Publisher: O'Reilly Pub Date: February 2006 Print ISBN-10: 0-596-10209-7 Print ISBN-13: 978-0-59-610209-8 Pages: 552 Table of Contents | Index Learning C# 2005, Second Edition Dedication Preface About This Book Who This Book Is For How the Book Is Organized Conventions Used in This Book Using Code Examples Support We'd Like to Hear from You Safari® Enabled Acknowledgments Chapter 1 C# and NET Programming Section 1.1 C# 2005 and NET 2.0 Section 1.2 The NET Platform Section 1.3 The NET 2.0 Framework Section 1.4 The C# Language Section 1.5 The Structure of C# Applications Section 1.6 The Development Environment Section 1.7 What's in a Program? Section 1.8 Your First Program: Hello World Section 1.9 The Compiler Section 1.10 Examining Your First Program Section 1.11 Summary Section 1.12 Quiz Section 1.13 Exercise Chapter 2 Visual Studio 2005 Section 2.1 Before You Read Further Section 2.2 Start Page Section 2.3 Projects and Solutions Section 2.4 Inside the Integrated Development Environment Section 2.5 Building and Running Section 2.6 Menus and Toolbars Section 2.7 Summary Section 2.8 Quiz Section 2.9 Exercise Chapter 3 C# Language Fundamentals Section 3.1 Statements Section 3.2 Types Section 3.3 Variables Section 3.4 Definite Assignment Section 3.5 Constants Section 3.6 Strings Section 3.7 Expressions Section 3.8 Whitespace Section 3.9 Summary Section 3.10 Quiz Section 3.11 Exercises Chapter 4 Operators Section 4.1 The Assignment Operator (=) Section 4.2 Mathematical Operators Section 4.3 Increment and Decrement Operators Section 4.4 Relational Operators Section 4.5 Summary Section 4.6 Quiz Section 4.7 Exercises Chapter 5 Branching Section 5.1 Unconditional Branching Statements Section 5.2 Conditional Branching Statements Section 5.3 Iteration (Looping) Statements Section 5.4 Summary Section 5.5 Quiz Section 5.6 Exercises Chapter 6 Object-Oriented Programming Section 6.1 Creating Models Section 6.2 Classes and Objects Section 6.3 Defining a Class Section 6.4 Class Relationships Section 6.5 The Three Pillars of Object-Oriented Programming Section 6.6 Object-Oriented Analysis and Design Section 6.7 Summary Section 6.8 Quiz Section 6.9 Exercises Chapter 7 Classes and Objects Section 7.1 Defining Classes Section 7.2 Method Arguments Section 7.3 Constructors Section 7.4 Initializers Section 7.5 The this Keyword Section 7.6 Static and Instance Members Section 7.7 Destroying Objects Section 7.8 Memory Allocation: The Stack Versus the Heap Section 7.9 Summary Section 7.10 Quiz Section 7.11 Exercises Chapter 8 Inside Methods Section 8.1 Overloading Methods Section 8.2 Encapsulating Data with Properties Section 8.3 Returning Multiple Values Section 8.4 Summary Section 8.5 Quiz Section 8.6 Exercises Chapter 9 Basic Debugging Section 9.1 Setting a Breakpoint Section 9.2 Examining Values: The Autos and Locals Windows Section 9.3 Set Your Watch Section 9.4 The Call Stack Section 9.5 Summary Section 9.6 Quiz Section 9.7 Exercises Chapter 10 Arrays Section 10.1 Using Arrays Section 10.2 The foreach Statement Section 10.3 Initializing Array Elements Section 10.4 The params Keyword Section 10.5 Multidimensional Arrays Section 10.6 Array Methods Section 10.7 Sorting Arrays Section 10.8 Summary Section 10.9 Quiz Section 10.10 Exercises Chapter 11 Inheritance and Polymorphism Section 11.1 Specialization and Generalization Section 11.2 Inheritance Section 11.3 Polymorphism Section 11.4 Abstract Classes Section 11.5 Sealed Classes Section 11.6 The Root of All Classes: Object Section 11.7 Boxing and Unboxing Types Section 11.8 Summary Section 11.9 Quiz Section 11.10 Exercises Chapter 12 Operator Overloading Section 12.1 Using the operator Keyword Section 12.2 Creating Useful Operators Section 12.3 The Equals Operator Section 12.4 Conversion Operators Section 12.5 Summary Section 12.6 Quiz Section 12.7 Exercises Chapter 13 Interfaces Section 13.1 Implementing an Interface Section 13.2 Implementing More than One Interface Section 13.3 Casting to an Interface Section 13.4 The is and as Operators Section 13.5 Extending Interfaces Section 13.6 Combining Interfaces Section 13.7 Overriding Interface Implementations Section 13.8 Explicit Interface Implementation Section 13.9 Summary Section 13.10 Quiz Section 13.11 Exercises Chapter 14 Generics and Collections Section 14.1 Generics Section 14.2 Collection Interfaces Section 14.3 Creating Your Own Collections Section 14.4 Framework Generic Collections Section 14.5 Summary Section 14.6 Quiz Section 14.7 Exercises Chapter 15 Strings Section 15.1 Creating Strings Section 15.2 Manipulating Strings Section 15.3 Regular Expressions Section 15.4 The Regex Class Section 15.5 Summary Section 15.6 Quiz Section 15.7 Exercises Chapter 16 Throwing and Catching Exceptions Section 16.1 Bugs, Errors, and Exceptions Section 16.2 Throwing Exceptions Section 16.3 Searching for an Exception Handler Section 16.4 The throw Statement Section 16.5 The try and catch Statements Section 16.6 How the Call Stack Works Section 16.7 Creating Dedicated catch Statements Section 16.8 The finally Statement Section 16.9 Exception Class Methods and Properties Section 16.10 Custom Exceptions Section 16.11 Summary Section 16.12 Quiz Section 16.13 Exercises Chapter 17 Delegates and Events Section 17.1 Delegates Section 17.2 Multicasting Section 17.3 Events Section 17.4 Using Anonymous Methods Section 17.5 Summary Section 17.6 Quiz Section 17.7 Exercises Chapter 18 Creating Windows Applications Section 18.1 Creating a Simple Windows Form Section 18.2 Creating a Real-World Application Section 18.3 XML Documentation Comments Section 18.4 Summary Section 18.5 Quiz Section 18.6 Exercises Chapter 19 Programming ASP.NET Applications Section 19.1 Understanding Web Forms Section 19.2 Web Form Events Section 19.3 Creating a Web Form Section 19.4 Adding Controls Section 19.5 Server Controls Section 19.6 Data Binding Section 19.7 Adding Controls and Events Section 19.8 Summary Section 19.9 Quiz Section 19.10 Exercises Appendix A Answers to Quizzes and Exercises Section A.1 Chapter 1: C# and NET Programming Section A.2 Chapter 2: Visual Studio 2005 Section A.3 Chapter 3: C# Language Fundamentals Section A.4 Chapter 4: Operators Section A.5 Chapter 5: Branching Section A.6 Chapter 6: Object-Oriented Programming Section A.7 Chapter 7: Classes and Objects Section A.8 Chapter 8: Inside Methods Section A.9 Chapter 9: Basic Debugging Section A.10 Chapter 10: Arrays Section A.11 Chapter 11: Inheritance and Polymorphism Section A.12 Chapter 12: Operator Overloading Section A.13 Chapter 13: Interfaces Section A.14 Chapter 14: Generics and Collections Section A.15 Chapter 15: Strings Section A.16 Chapter 16: Throwing and Catching Exceptions Section A.17 Chapter 17: Delegates and Events Section A.18 Chapter 18: Creating Windows Applications Section A.19 Chapter 19: Programming ASP.NET Applications About the Author Colophon Index Learning C# 2005, Second Edition by Jesse Liberty and Brian MacDonald Copyright © 2006, 2002 O'Reilly Media, Inc All rights reserved Printed in the United States of America Published by O'Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472 O'Reilly books may be purchased for educational, business, or sales promotional use Online editions are also available for most titles (safari.oreilly.com) For more information, contact our corporate/institutional sales department: (800) 998-9938 or corporate@oreilly.com Editor: John Osborn Production Editor: Matt Hutchinson Production Services: Octal Publishing, Inc Cover Designer: Hanna Dyer Interior Designer: David Futato Illustrators: Robert Romano, Jessamyn Read, and Lesley Borash Printing History: September 2002: First Edition compilers FileCopier utility Hello World HTML, viewing methods spaghetti code specialization inheritance polymorphism object-oriented programming Split( ) method 2nd 3rd splitting strings 2nd 3rd square brackets ([ ]) Stack class stacks applying call generics unwinding 2nd StackTrace property Start Page (Visual Studio 2005) starting programs state Web Form events statements braces ({}) 2nd branching conditional unconditional break case catch dedicated continue expressions finally foreach, arrays goto, creating loops with if nested single-statement blocks if else looping switch strings throw try whitespace WriteLine( ) static fields, applying static keyword static members static methods, invoking Status property String class methods/properties String.Compare( ) method StringBuilder class strings comparing concatenating copying creating equality, testing escape characters literals manipulating modifying Regex class regular expressions splitting 2nd 3rd substrings, searching switch statements verbatim structs, creating structure of applications stubbing out methods subdirectories, recursing through Subscribe( ) method subscribing events Substring( ) method substrings, searching subtraction operator (-) SuppressFinalize( ) method switch statements strings symbolic constants symbols, searching syntax System namespace System.Array System.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] [Z] Tabbed Document window Task List window 2nd templates web sites ternary operator Tester class TestFunc( ) method testing strings for equality text files, inserting fonts, editing incremental searches text editors, navigating this keyword throw statement throwing exceptions call stacks finally statement Time class, creating TimeHasChanged( ) method ToArray( ) method toolbars Toolbox command Toolbox window Tools Menu ToString( ) method delegates overriding tracking method calls objects/variables TreeNode objects trees, root classes TreeView controls, populating TreeView objects, event handling troubleshooting debugging setting breakpoints viewing values Watch window delegates try statement Turbo Pascal type safety types arrays accessing elements applying declaring default values foreach statements initializing elements methods multidimensional params keyword sorting bool boxing char delegates doublefloat type errors exceptions float generics intrinsic methods, defining behavior non-numeric numeric polymorphic, creating primitive, values references 2nd runtime unboxing values passing by references 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] [Z] UI forms, creating UML (Unified Modeling Language), specialization unboxing types Uncompress( ) method unconditional branching statements unhandled exceptions Unified Modeling Language (UML), specialization unsigned numeric types unwinding stacks 2nd Use checkbox use-case scenarios utilities debuggers, setting breakpoints FileCopier source code Find in Files ILDasm 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] [Z] value keyword values constants debugging, viewing default, arrays dictionaries expressions indexers, assigning initializers integers, indexers multiple, returning primitive types references, passing types by types variables 2nd definite assignment expanding initializers local tracking verbatim strings versioning with new/override keywords vertical bar (|) View menu viewing attributes breakpoints HTML source code programs values, debugging views, HTML virtual methods, overriding Visual Studio 2005 applications, building and running classes, renaming Designer menus navigating projects and solutions Start Page toolbars Web Forms XML documentation comments void keyword 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] [Z] warnings, removing Watch window web applications, creating Web Forms controls adding server creating events web sites, New Web Site menu while (true) construct while loops whitespace wildcards Wiltamuth, Scott Window menu Windows NET Framework applications controls forms creating creating real-world applications windows Auto Hide Autos 2nd 3rd Bookmark Breakpoints Call Stack Code Definition Command Dockable Document Outline Dynamic Help Error List 2nd Find Results Find Symbol Results floating Hide Locals Macro Explorer Object Browser Output 2nd Properties 2nd Refractor View resizing Server Explorer Tabbed Document Task List 2nd text editing Toolbox Watch wizards, Data Source Configuration Write( ) method, IStorable interface WriteLine( ) method WriteLine( ) statement 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] [Z] XML documentation comments 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] [Z] zeros, comparing strings ... Section 13.11 Exercises Chapter 14 Generics and Collections Section 14.1 Generics Section 14.2 Collection Interfaces Section 14.3 Creating Your Own Collections Section 14.4 Framework Generic Collections... Chapter 5: Branching Section A.6 Chapter 6: Object-Oriented Programming Section A.7 Chapter 7: Classes and Objects Section A.8 Chapter 8: Inside Methods Section A.9 Chapter 9: Basic Debugging Section A.10 Chapter 10: Arrays... Section 16.3 Searching for an Exception Handler Section 16.4 The throw Statement Section 16.5 The try and catch Statements Section 16.6 How the Call Stack Works Section 16.7 Creating Dedicated catch Statements

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

Mục lục

  • Learning C# 2005

  • Table of Contents

  • Learning C# 2005, Second Edition

    • Dedication

    • Preface

      • About This Book

      • Who This Book Is For

      • How the Book Is Organized

      • Conventions Used in This Book

      • Using Code Examples

      • Support

      • We'd Like to Hear from You

      • Safari® Enabled

      • Acknowledgments

      • Chapter 1. C# and .NET Programming

        • Section 1.1. C# 2005 and .NET 2.0

        • Section 1.2. The .NET Platform

        • Section 1.3. The .NET 2.0 Framework

        • Section 1.4. The C# Language

        • Section 1.5. The Structure of C# Applications

        • Section 1.6. The Development Environment

        • Section 1.7. What's in a Program?

        • Section 1.8. Your First Program: Hello World

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

Tài liệu liên quan