Before You Begin

Please read this section before using the book to ensure that your computer is set up properly.

Font and Naming Conventions

We use fonts to distinguish between features, such as menu names, menu items, and other elements that appear in the program-development environment. Our convention is

  • to emphasize Visual Studio features in a sans-serif bold font (e.g., Properties window) and

  • to emphasize program text in a fixed-width sans-serif font (e.g., bool x = true).

Visual Studio 2015 Community Edition

This textbook uses Windows 10 and the free Microsoft Visual Studio 2015 Community edition—Visual Studio also can run on various older Windows versions. Ensure that your system meets Visual Studio 2015 Community edition’s minimum hardware and software requirements listed at:


https://www.visualstudio.com/en-us/visual-studio-2015-system-
   requirements-vs

Next, download the installer from


https://www.visualstudio.com/products/visual-studio-express-vs

then execute it and follow the on-screen instructions to install Visual Studio.

Though we developed the book’s examples on Windows 10, the examples will run on Windows 7 and higher—with the exception of those in our online Universal Windows Platform (UWP) presentation. Most examples without graphical user interfaces (GUIs) also will run on other C# and .NET implementations—see “If You’re Not Using Microsoft Visual C#…” later in this Before You Begin for more information.

Viewing File Extensions

Several screenshots in Visual C# How to Program, 6/e display file names with file-name extensions (e.g., .txt, .cs, .png, etc.). You may need to adjust your system’s settings to display file-name extensions. If you’re using Windows 7:

  1. Open Windows Explorer.

  2. Press the Alt key to display the menu bar, then select Folder Options… from the Tools menu.

  3. In the dialog that appears, select the View tab.

  4. In the Advanced settings pane, uncheck the box to the left of the text Hide extensions for known file types.

  5. Click OK to apply the setting and close the dialog.

If you’re using Windows 8 or higher:

  1. Open File Explorer.

  2. Click the View tab.

  3. Ensure that the File name extensions checkbox is checked.

Obtaining the Source Code

Visual C# How to Program, 6/e’s source-code examples are available for download at


http://www.deitel.com/books/VCsharpHTP6

Click the Examples link to download the ZIP archive file to your computer—most brows-ers will save the file into your user account’s Downloads folder. You can extract the ZIP file’s contents using built-in Windows capabilities, or using a third-party archive-file tool such as WinZip (www.winzip.com) or 7-zip (www.7-zip.org).

Throughout the book, steps that require you to access our example code on your computer assume that you’ve extracted the examples from the ZIP file and placed them in your user account’s Documents folder. You can extract them anywhere you like, but if you choose a different location, you’ll need to update our steps accordingly. To extract the ZIP file’s contents using the built-in Windows capabilities:

  1. Open Windows Explorer (Windows 7) or File Explorer (Windows 8 and higher).

  2. Locate the ZIP file on your system, typically in your user account’s Downloads folder.

  3. Right click the ZIP file and select Extract All….

  4. In the dialog that appears, navigate to the folder where you’d like to extract the contents, then click the Extract button.

Configuring Visual Studio for Use with This Book

In this section, you’ll use Visual Studio’s Options dialog to configure several Visual Studio options. Setting these options is not required, but will make your Visual Studio match what we show in the book’s Visual Studio screen captures.

Visual Studio Theme

Visual Studio has three color themes—Blue, Dark and Light. We used the Blue theme with light colored backgrounds to make the book’s screen captures easier to read. To switch themes:

  1. In the Visual Studio Tools menu, select Options… to display the Options dialog.

  2. In the left column, select Environment.

  3. Select the Color theme you wish to use.

Keep the Options dialog open for the next step.

Line Numbers

Throughout the book’s discussions, we refer to code in our examples by line number. Many programmers find it helpful to display line numbers in Visual Studio as well. To do so:

  1. Expand the Text Editor node in the Options dialog’s left pane.

  2. Select All Languages.

  3. In the right pane, check the Line numbers checkbox.

Keep the Options dialog open for the next step.

Tab Size for Code Indents

Microsoft recommends four-space indents in source code, which is the Visual Studio default. Due to the fixed and limited width of code lines in print, we use three-space indents—this reduces the number of code lines that wrap to a new line, making the code a bit easier to read. If you wish to use three-space indents:

  1. Expand the C# node in the Options dialog’s left pane and select Tabs.

  2. Ensure that Insert spaces is selected.

  3. Enter 3 for both the Tab size and Indent size fields.

  4. Click OK to save your settings.

If You’re Not Using Microsoft Visual C#…

C# can be used on other platforms via two open-source projects managed by the .NET Foundation (http://www.dotnetfoundation.org)—the Mono Project and .NET Core.

Mono Project

The Mono Project is an open source, cross-platform C# and .NET Framework implementation that can be installed on Linux, OS X (soon to be renamed as macOS) and Windows. The code for most of the book’s console (non-GUI) apps will compile and run using the Mono Project. Mono also supports Windows Forms GUI, which is used in Chapters 1415 and several later examples. For more information and to download Mono, visit:


http://www.mono-project.com/

.NET Core

.NET Core is a new cross-platform .NET implementation for Windows, Linux, OS X and FreeBSD. The code for most of the book’s console (non-GUI) apps will compile and run using .NET Core. At the time of this writing, a .NET Core version for Windows was available and versions were still under development for other platforms. For more information and to download .NET Core, visit:


https://dotnet.github.io/

You’re now ready to learn C# and the .NET platform with Visual C# How to Program, 6/e. We hope you enjoy the book!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset