MSPress-C#2005ExpressEdition-BuildaProgramNow.pdf

(7234 KB) Pobierz
64997160 UNPDF
64997160.099.png
Build a Program
Visual C# ® 2005
Express Edition
Microsoft ®
64997160.109.png 64997160.115.png 64997160.121.png 64997160.001.png 64997160.007.png 64997160.017.png 64997160.023.png 64997160.029.png 64997160.035.png 64997160.041.png 64997160.057.png 64997160.068.png 64997160.080.png 64997160.081.png 64997160.082.png 64997160.083.png 64997160.084.png 64997160.085.png 64997160.086.png 64997160.087.png 64997160.088.png 64997160.089.png 64997160.090.png 64997160.091.png 64997160.092.png 64997160.093.png 64997160.094.png 64997160.095.png 64997160.096.png 64997160.097.png 64997160.098.png
PUBLISHED BY
Microsoft Press
A Division of Microsoft Corporation
One Microsoft Way
Redmond, Washington 98052-6399
Copyright © 2006 by Microsoft Corporation
All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means without the written permission
of the publisher.
Library of Congress Control Number 2005933642
Printed and bound in the United States of America.
1 2 3 4 5 6 7 8 9 QWT 9 8 7 6 5
Distributed in Canada by H.B. Fenn and Company Ltd.
A CIP catalogue record for this book is available from the British Library.
Microsoft Press books are available through booksellers and distributors worldwide. For further information about international editions,
contact your local Microsoft Corporation offi ce or contact Microsoft Press International directly at fax (425) 936-7329. Visit our Web site
at www.microsoft.com/learning/. Send comments to mspinput@microsoft.com.
Microsoft, Active Directory, FrontPage, Intellisense, Microsoft Press, MSDN, SharePoint, Visual Basic, Visual C#, Visual J#, Visual Studio,
Visual Web Developer, Windows, and Windows Server are either registered trademarks or trademarks of Microsoft Corporation in the United States
and/or other countries.
The example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted herein are fi ctitious. No
association with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred.
This book expresses the author·s views and opinions. The information contained in this book is provided with out any express, statutory, or implied
warranties. Neither the authors, Microsoft Corporation, nor its resellers, or distributors will be held liable for any damages caused or alleged to be
caused either directly or indirectly by this book.
Acquisitions Editor: Ben Ryan
Project Editor: Sandra Haynes
Editorial and Production: Custom Editorial Productions, Inc.
Body Part No. X11-50121
64997160.100.png 64997160.101.png 64997160.102.png 64997160.103.png 64997160.104.png 64997160.105.png 64997160.106.png 64997160.107.png 64997160.108.png 64997160.110.png 64997160.111.png 64997160.112.png 64997160.113.png 64997160.114.png 64997160.116.png 64997160.117.png 64997160.118.png 64997160.119.png 64997160.120.png 64997160.122.png 64997160.123.png 64997160.124.png 64997160.125.png 64997160.126.png 64997160.002.png 64997160.003.png 64997160.004.png 64997160.005.png 64997160.006.png 64997160.008.png
Contents
Coding Your Console Application
37
Chapter 1
Introducing Microsoft® Visual C#® 2005 Express
Edition 1
What Is .NET? 2
What Is C#? 4
Is C# an Object-Oriented Programming (OOP) Language? 4
What Is Visual C# 2005 Express Edition?
Customizing the IDE
39
Creating a Windows Application
41
9
Chapter 4
Create Your Own Web Browser in Less Than
Five Minutes!
45
46
What Is a Project?
What Kinds of Applications Can You Build with
Visual C# 2005 Express Edition?
10
What Is the Design Layout?
47
What Are the Key Features You Need to Know About?
11
Putting It All Together
54
Chapter 2
Installing Visual C#
®
2005 Express Edition
15
Chapter 5
Creating Your First Full Windows Application
57
Preparing to Install Visual C# 2005 Express Edition
16
Snap and Align Those Controls Using Snap Lines
58
Installing Visual C# 2005 Express Edition
17
Using IntelliSense Your New Best Friend!
59
IntelliSense and Ctrl+Spacebar
60
IntelliSense and Period/Left Parenthesis
60
Chapter 3
Creating Your First Application
25
IntelliSense Filtering: Pre-Selecting the "Most Recently
Used"
62
Two Types of Applications: What’s the Difference?
26
IntelliSense Code Snippets: The Time Saver
63
Getting Started
27
How to Invoke Code Snippets
64
IDE Components
30
IntelliSense Auto-Using Statements
66
On to the Projects
31
Renaming and Refactoring
66
Building a Console Application
31
What Can You Rename?
67
Getting to Know Solution Explorer
32
How and Where to Use the Rename Feature
67
Getting Help: Microsoft Visual Studio 2005 Express Edition
Documentation
33
Refactoring–Extract Method
70
Common Windows Controls
71
What do you think of this book?
We want to hear from you!
Microsoft is interested in hearing your feedback about this publication so we can
continually improve our books and learning resources for you. To participate in a brief
online survey, please visit: www.microsoft.com/learning/booksurvey/
iii
64997160.009.png 64997160.010.png 64997160.011.png 64997160.012.png 64997160.013.png 64997160.014.png 64997160.015.png 64997160.016.png 64997160.018.png 64997160.019.png 64997160.020.png 64997160.021.png 64997160.022.png 64997160.024.png 64997160.025.png 64997160.026.png 64997160.027.png 64997160.028.png 64997160.030.png 64997160.031.png 64997160.032.png 64997160.033.png 64997160.034.png 64997160.036.png 64997160.037.png 64997160.038.png 64997160.039.png 64997160.040.png 64997160.042.png 64997160.043.png
Chapter 6
Modify Your Web Browser Now!
81
Chapter 9
Build Your Own Weather Tracker
Application Now!
165
How to Bring Up Your Application
82
Adding an About Box Dialog
89
Features of the Weather Tracker Application
166
Adding a Navigate Dialog Box
92
The High-Level Plan
167
Adding a Tool Strip Container and Some Tools
96
Creating the Application User Interface
168
Adding a Status Bar to Your Browser
98
Adding Notification Area Capabilities
169
Personalize Your Application with Windows Icons
102
Adding the Splash Screen and About Dialog Box
176
Adding the Options Dialog Box
179
Chapter 7
Fixing the Broken Blocks 111
Debugging an Application 112
Using a DLL in an Application 112
Adding a Reference to Your Application 113
Breakpoints, Locals, Edit and Continue, and Visualizers 114
Using Web Services
181
Chapter 8
Managing the Data 127
What Is a Database? 128
What’s In a Database? 128
Data Normalization and Data Integrity 129
What Is Null? 132
What Are Primary Keys and Foreign Keys? 132
How Do You Interact with a Relational Database? 135
SQL Server 2005 Express in Visual C# 2005 Express Edition 136
Creating a Database Using Visual C# 2005 Express Edition 137
Creating Tables in Your Database 139
Creating Relationships Between the Tables 141
Entering Data in SQL Server Tables Using Visual Studio 145
What Are ADO.NET and Databinding? 148
The Car Tracker Application Development 150
How Do I Get More Meaningful Information on My Form? 156
iv
Microsoft Visual C# 2005 Express Edition: Build a Program Now!
64997160.044.png 64997160.045.png 64997160.046.png 64997160.047.png 64997160.048.png 64997160.049.png 64997160.050.png 64997160.051.png 64997160.052.png 64997160.053.png 64997160.054.png 64997160.055.png 64997160.056.png 64997160.058.png 64997160.059.png 64997160.060.png 64997160.061.png 64997160.062.png 64997160.063.png 64997160.064.png 64997160.065.png 64997160.066.png 64997160.067.png 64997160.069.png 64997160.070.png 64997160.071.png 64997160.072.png 64997160.073.png 64997160.074.png 64997160.075.png 64997160.076.png 64997160.077.png 64997160.078.png 64997160.079.png
Zgłoś jeśli naruszono regulamin