SKIP THE SHIPPING
Use code NOSHIP during checkout to save 40% on eligible eBooks, now through January 5. Shop now.
Register your product to gain access to bonus material or receive a coupon.
The professional programmer’s Deitel® guide to C# 2010 and the powerful Microsoft® .NET 4 Framework
Written for programmers with a background in C++, Java or other high-level, object-oriented languages, this book applies the Deitel signature live-code approach to teaching programming and explores Microsoft’s C# 2010 language and .NET 4 in depth. The book is updated for Visual Studio® 2010 and C# 4, and presents C# concepts in the context of fully tested programs, complete with syntax shading, detailed line-by-line code descriptions and program outputs. The book features 200+ C# applications with 17,000+ lines of proven C# code, as well as hundreds of programming tips that will help you build robust applications.
Start with a concise introduction to C# fundamentals using an early classes and objects approach, then rapidly move on to more advanced topics, including multithreading, .NET 4, LINQ, WPF, ASP.NET 4, WCF web services and Silverlight®. Along the way you’ll enjoy the Deitels’ classic treatment of object-oriented programming and the OOD/UML® ATM case study, including a complete C# implementation. When you’re finished, you’ll be ready to build next-generation Windows applications, web applications and web services.
Check out the related LiveLessons video product, C# 2010 Fundamentals: Parts I, II and III, containing 20+ hours of video synchronized to this book: www.deitel.com/livelessons.
Practical, example-rich coverage of:
Visit www.deitel.com
Testimonials from the Third and Fourth Edition Reviewers
“Takes you from zero to the highest levels of C# programming proficiency. The pedagogical approach and wealth of online material guarantee this book an outstanding place among its peers. The best presentation on inheritance, interfaces and polymorphism I have seen in my 25+ years as a trainer and consultant! Superbly clear.”
—Octavio Hernandez, Microsoft C# MVP, Advanced Bionics
“The ultimate, comprehensive book that teaches you how to program using the latest Microsoft technologies. Excellent explanations, lots of examples, all the necessary theoretical background and all the latest technologies for desktop, web and databases. The best overview of Silverlight.”
—Kirill Osenkov, Visual Studio Languages Team, Microsoft
“Illustrates the best practices of C# programming.”
“Excellent introduction to the world of .NET for the beginning C# programmer, using the Deitels’ live-code approach and real-world examples.”
“Shows the practical application of the most recent topics in C# development. A gentle introduction to LINQ and the .NET collection classes; I like it very much! Shows a lot of useful basic techniques and most of the ‘second level facts’ needed to develop WinForms apps. I like the way you introduce working with databases using LINQ to SQL. Excellent introduction to ASP.NET. A very good introduction to generics. Outstanding chapter on collections; the discussion of the new co- and contra-variance capabilities is by necessity short, but very nice.”
—Octavio Hernandez, Microsoft C# MVP, Advanced Bionics
“The code examples provide a very good start on C# programming. A good job explaining the concepts of classes and objects in plain English. The arrays chapter is well done. A nice introduction to LINQ and Collections. The code examples in the chapter on polymorphism and interfaces are excellent. Important exception-related topics are explained with good examples.”
“Teaches how to ‘program in the large,’ with material on object-oriented programming and software engineering principles.”
“An excellent, true objects-first book. Excellent introduction to data structures and collections. The generics material is a real asset.”
“Great chapter on polymorphism.”
“Excellent chapter on exceptions. Very good chapter on Winforms GUIs.”
“Updated contents cover the most important additions to the language while maintaining the Deitels’ well-known high-quality. The early introduction to classes and objects is brilliant. I especially like the explanation of properties, and the discussion of value types vs. reference types. [Classes and Objects: A Deeper Look] does a really good job providing good practices for accessing private data and reusing code. The [Data Structures] chapter is very well written. Coverage of ASP.NET is exceptional.”
“Perfect for professionals. Thorough introductions to the debugger and LINQ.”
“The TV/Video Viewer will enthuse readers and help them see how graphics effects can be created easily in WPF.”
“An excellent introduction to XML, LINQ to XML and related technologies.”—Helena Kotas, Microsoft
“Good overview of relational databases. It hits on the right LINQ to SQL idioms.”
“Great overview of producing and consuming web services with WCF.”
[Chapter 24: GUI with Windows Presentation Foundation] “This chapter is very well written. I especially liked your coverage of GUI customization and data bindings, which is very clear.”
[Chapter 24: GUI with Windows Presentation Foundation] “Excellent chapter! Everything is laid out right so that every required bit of knowledge is already there when needed.”
[Chapter 25: WPF Graphics and Multimedia] “An already excellent chapter that got even better! This chapter perfectly complements the previous one, and offers great examples and explanations. The new example on speech synthesis and speech recognition is very nice, and the very first I’ve seen in any C# book to date.”
[Chapter 26: XML and LINQ to XML]
“Excellent chapter! The presentation of LINQ to XML is fabulous!”
Download all the examples in one convenient download (359.8 MB)
Download the examples for Chapter 1
Download the examples for Chapter 2
Download the examples for Chapter 3
Download the examples for Chapter 4
Download the examples for Chapter 5
Download the examples for Chapter 6
Download the examples for Chapter 7
Download the examples for Chapter 8
Download the examples for Chapter 9
Download the examples for Chapter 10
Download the examples for Chapter 10
Download the examples for Chapter 11
Download the examples for Chapter 12
Download the examples for Chapter 13
Download the examples for Chapter 14
Download the examples for Chapter 15
Download the examples for Chapter 16
Download the examples for Chapter 17
Download the examples for Chapter 18
Download the examples for Chapter 19
Download the examples for Chapter 20
Download the examples for Chapter 21
Download the examples for Chapter 22
Download the examples for Chapter 23
Download the examples for Chapter 24
Download the examples for Chapter 25 (274.2 MB)
Download the examples for Chapter 26
Download the examples for Chapter 27
Download the examples for Chapter 28
Download the examples for Chapter 29 (70.4 MB)
Download the examples for Chapter 31
Download the examples for Appendix F
Download the examples for Appendix G
Introduction to C# Applications
Preface xxi
Before You Begin xxxiv
Chapter 1: Introduction 1
1.1 Introduction 2
1.2 Microsoft’s Windows® Operating System 2
1.3 C, C++, Objective-C and Java 3
1.4 C# 3
1.5 Extensible Markup Language (XML) 4
1.6 Introduction to Microsoft .NET 4
1.7 The .NET Framework and the Common Language Runtime 4
1.8 Test-Driving the Advanced Painter Application 5
1.9 Introduction to Object Technology 8
1.10 Wrap-Up 10
Chapter 2: Dive Into® Visual C# 2010 Express 11
2.1 Introduction 12
2.2 Overview of the Visual Studio 2010 IDE 12
2.3 Menu Bar and Toolbar 17
2.4 Navigating the Visual Studio IDE 19
2.5 Using Help 24
2.6 Using Visual Programming to Create a Simple Program that Displays Text and an Image 27
2.7 Wrap-Up 38
2.8 Web Resources 39
Chapter 3: Introduction to C# Applications 40
3.1 Introduction 41
3.2 A Simple C# Application: Displaying a Line of Text 41
3.3 Creating a Simple Application in Visual C# Express 46
3.4 Modifying Your Simple C# Application 53
3.5 Formatting Text with Console.Write and Console.WriteLine 56
3.6 Another C# Application: Adding Integers 57
3.7 Arithmetic 59
3.8 Decision Making: Equality and Relational Operators 61
3.9 Wrap-Up 65
Chapter 4: Introduction to Classes and Objects 66
4.1 Introduction 67
4.2 Classes, Objects, Methods, Properties and Instance Variables 67
4.3 Declaring a Class with a Method and Instantiating an Object of a Class 68
4.4 Declaring a Method with a Parameter 72
4.5 Instance Variables and Properties 75
4.6 UML Class Diagram with a Property 80
4.7 Software Engineering with Properties and set and get Accessors 81
4.8 Auto-Implemented Properties 82
4.9 Value Types vs. Reference Types 83
4.10 Initializing Objects with Constructors 84
4.11 Floating-Po