C# 2010 All-in-One For Dummies

C# 2010 All-in-One For Dummies

Bill Sempf

Language: English

Pages: 864

ISBN: B005ZIPQFG

Format: PDF / Kindle (mobi) / ePub


A logical, straightforward approach to learning the C# language

C# is a complicated programming language for building .NET-connected software for Microsoft Windows, the Web, and a wide range of devices. The friendly All-in-One For Dummies format is a perfect way to present it. Each minibook is a self-contained package of necessary information, making it easy to find what you're looking for.

Upgrades in C# 2010 include the ability to build Windows 7 applications and compatibility with Python and Ruby.

  • C# is a somewhat complex programming language for building .NET-connected software for Microsoft Windows, the Web, and other devices
  • Beginning C# programmers will appreciate how the All-in-One format breaks the topic into minibooks, each one addressing a key body of information
  • Minibooks include creating your first C# program, Windows 7 programming, basic C# programming, object-based programming, object-oriented programming, Windows programming with C# and Visual Studio, and debugging
  • Companion Web site includes all sample code

Beginning C# programmers will find C# 2010 All-in-One For Dummies explains a complicated topic in an easy, understandable way.

Note: CD-ROM/DVD and other supplementary materials are not included as part of eBook file.

 

 

 

 

 

 

 

 

 

 

 

 

specific situation is different. Some interpolation has to be taking place. If you have a question about how your personal situation fits in, send the author an e-mail at csharpfordummies.net and we’ll try to help. What You Need in Order to Use This Book You need, at minimum, the .NET Common Language Runtime (CLR) before you can even execute the programs generated by C#. Visual Studio 2010 copies the CLR onto your machine as part of its installation procedure. Alternatively, you can download the

that command isn’t available on your Visual Studio Tools menu, choose Start➪All Programs➪Microsoft Visual Studio 2008➪Visual Studio Tools➪Visual Studio 2008 Command Prompt. Reviewing Your Console Application In the following sections, you take this first C# console app apart one section at a time to understand how it works. The program framework The basic framework for all console applications starts as the following: using using using using System; System.Collections.Generic; System.Linq;

capital letter, and variables start with a lowercase letter. Make these names as descriptive as possible — which often means that a name consists of multiple words. These words should be capitalized but butted up against each other with no underscore between them — for example, ThisIsALongName. Names that start with a capital are Pascal-cased, from the way a 1970s-era language called Pascal named things. (My first book was about Pascal.) ✓ The names of variables start with a lower- case letter.

100, it’s also evenly divisible by 400 You don’t have enough tools yet to tackle that in C#. But you could just ask the DateTime type (which is a value type, like int): 06_563489-bk01ch02.indd 38 3/19/10 8:01 PM Calculating Leap Years: DateTime 39 DateTime thisYear = new DateTime(2011, 1, 1); bool isLeapYear = DateTime.IsLeapYear(thisYear.Year); Book I Chapter 2 The result for 2011 is false, but for 2012, it’s true. (For now, don’t worry about that first line of code, which uses some

here. } Console.WriteLine(); You can use that loop to solve the problem of deciding whether favoriteFood is all uppercase. (See the previous section for more about case.) 07_563489-bk01ch03.indd 53 3/19/10 7:57 PM 54 Searching Strings bool isUppercase = true; // Start with the assumption that it’s uppercase. foreach(char c in favoriteFood) { if(!char.IsUpper(c)) { isUppercase = false; // Disproves all uppercase, so get out. break; } } At the end of the loop, isUppercase will either be

Download sample

Download