Sams - Teach Yourself the C sharpLanguage in 21 Days.pdf

(8301 KB) Pobierz
Sams Teach Yourself the C# Language in 21 Days
64998445.002.png
Bradley L. Jones
Teach Yourself
the C#
Language
in 21 Days
800 East 96th St., Indianapolis, Indiana, 46240 USA
64998445.003.png
2004 by Bradley L. Jones
All rights reserved. No part of this book shall be reproduced, stored in a
retrieval system, or transmitted by any means, electronic, mechanical, photo-
copying, recording, or otherwise, without written permission from the pub-
lisher. No patent liability is assumed with respect to the use of the information
contained herein. Although every precaution has been taken in the preparation
of this book, the publisher and author assume no responsibility for errors or
omissions. Nor is any liability assumed for damages resulting from the use of
the information contained herein.
©
A SSOCIATE P UBLISHER
Michael Stephens
E XECUTIVE E DITOR
Candace Hall
D EVELOPMENT E DITOR
Mark Renfrow
M ANAGING E DITOR
Charlotte Clapp
P ROJECT E DITOR
Matthew Purcell
C OPY E DITOR
Krista Hansing
I NDEXER
Mandie Frank
P ROOFREADER
Paula Lowell
T ECHNICAL E DITOR
Anand Narayanaswamy
T EAM C OORDINATOR
Cindy Teeters
I NTERIOR D ESIGNER
Gary Adair
C OVER D ESIGNER
Alan Clements
P AGE L AYOUT
Michelle Mitchell
International Standard Book Number: 0-672-32546-2
Library of Congress Catalog Card Number: 2003092624
Printed in the United States of America
First Printing: July 2003
06
05
04
03
4 3 2
Trademarks
All terms mentioned in this book that are known to be trademarks or service
marks have been appropriately capitalized. Sams Publishing cannot attest to
the accuracy of this information. Use of a term in this book should not be
regarded as affecting the validity of any trademark or service mark.
Warning and Disclaimer
Every effort has been made to make this book as complete and as accurate as
possible, but no warranty or fitness is implied. The information provided is on
an “as is” basis. The author and the publisher shall have neither liability nor
responsibility to any person or entity with respect to any loss or damages aris-
ing from the information contained in this book.
Bulk Sales
Sams Publishing offers excellent discounts on this book when ordered in quan-
tity for bulk purchases or special sales. For more information, please contact:
U.S. Corporate and Government Sales
1-800-382-3419
corpsales@pearsontechgroup.com
For sales outside of the U.S., please contact:
International Sales
+1-317-428-3341
international@pearsontechgroup.com
Sams Teach Yourself the C# Language
in 21 Days
Copyright
64998445.004.png
Contents at a Glance
Introduction
1
Week 1 Week at a Glance 5
D AY 1 Getting Started with C# 7
T YPE & R UN 1 37
2 Understanding C# Programs 41
3 Manipulating Values in Your Programs 83
4 Controlling Your Program’s Flow 117
T YPE & R UN 2 145
5 The Core of C# Programming: Classes 153
6 Packaging Functionality: Class Methods and Member Functions 179
7 Storing More Complex Stuff: Structures, Enumerators, and Arrays 211
Week 1 Week in Review
245
Week 2 Week at a Glance 269
D AY 8 Advanced Method Access 271
9 Handling Problems in Your Programs: Exceptions and Errors 303
T YPE & R UN 3 347
10 Reusing Existing Code with Inheritance 357
11 Formatting and Retrieving Information 395
12 Tapping into OOP: Interfaces 429
13 Making Your Programs React with Delegates, Events, and Indexers 449
14 Making Operators Do Your Bidding: Overloading
473
Week 2 Week in Review
499
Week 3 Week at a Glance
519
D AY 15 Using Existing Routines from the .NET Base Classes
521
16 Creating Windows Forms
553
17 Creating Windows Applications
591
T YPE & R UN 4
631
18 Working with Databases: ADO.NET
643
64998445.005.png
19 Creating Remote Procedures (Web Services)
661
T YPE & R UN 5
677
20 Creating Web Applications
687
21 A Day for Reflection and Attributes
705
Week 3 Week in Review
733
Appendices
721
A PPENDIX A C# Keywords
723
B Command-Line Compiler Flags for Microsoft’s Visual C# .NET
735
C Understanding Number Systems
741
D Installing and Using SharpDevelop
745
Index
751
On CD-ROM
Answers
64998445.001.png
Zgłoś jeśli naruszono regulamin