Beginning C# Hands-On – The Core Language

A C# beginners guide to the core parts of the C# language!

Beginning C# Hands-On – The Core Language

Tom Owsiak

1 customer reviews
A C# beginners guide to the core parts of the C# language!
Mapt Subscription
FREE
$29.99/m after trial
eBook
$16.00
RRP $31.99
Save 49%
Print + eBook
$39.99
RRP $39.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$16.00
$39.99
$29.99p/m after trial
RRP $31.99
RRP $39.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781788296540
Paperback554 pages

Book Description

Beginning C# Hands-On - The Core Language teaches you core C# language and syntax in a working Visual Studio environment. This book covers everything from core language through to more advanced features such as object-oriented programming techniques. This book is for C# beginners who need a practical reference to core C# language features.

You'll also gain a view of C# through web programming with web forms, so you'll learn HTML, basic CSS, and how to use a variety of controls, such as buttons and drop-down lists. You'll start with the fundamentals of C# and Visual Studio, including defining variables, interacting with users, and understanding data types, data conversions, and constants.

You'll move on to checking conditions using if/else blocks, and see how to use loops to do things such as repeat blocks of code. After covering various operators to evaluate and assign control structures, you'll see how to use arrays to store collections of data. By the time you’ve finished the book, you’ll know how to program the vital elements of the core C# language. These are the building blocks that you can then combine to build complex C# programs.

Table of Contents

Chapter 1: Why C# and How to Download and Install the Visual Studio Community Edition
Locating and downloading the Visual Studio Community edition
Summary
Chapter 2: Customizing Visual Studio to Make it Feel More Personal
Customizing Visual Studio
Selecting the text editor font and size
Selecting the Statement Completion font and size
Selecting the Environment font and size
Positioning Visual Studio panels
Summary
Chapter 3: Creating and Running Your First Page
Starting a new project in Visual C#
Working with Solutions Explorer
Adding a document to your browser
Working with HTML code in Visual Studio
Launching the HTML code
Summary
Chapter 4: Creating and Running a Page That Incorporates C#
Improving your first program
Working in the Design view
Working in the Source view
Viewing the code in your browser
Summary
Chapter 5: Creating and Using a Single Variable
Setting up Visual C# to deal with a variable
Running the code
Summary
Chapter 6: String Interpolation and Updating Visual Studio
Selecting a NuGet package
Summary
Chapter 7: Formatting Output Strings for More Professional Results
Setting a value and formatting it as currency
Summary
Chapter 8: Using Variables and Data Types
Setting a page title automatically
Summary
Chapter 9: Computed Variables and Basic Math
Declaring and setting two variables to signify two different salaries
Summary
Chapter 10: Interacting with Users Through the Web Page
Using Toolbox to search for a command
Summary
Chapter 11: Using Method Chaining to Write More Compact Code
Inserting a text box into the markup
Summary
Chapter 12: Reacting to a Single Condition with If/Else Blocks
Adding checkbox to your code
Chapter 13: Making a Variable Grow by Adding 1
Growing a variable by one
Summary
Chapter 14: Repeating Blocks of Code with While Loops
Inserting a button
Summary
Chapter 15: Repeating Blocks of Code with For Loops
Inserting a button
Summary
Chapter 16: Iterating Over Collections with foreach Loops
Inserting TextBox
Summary
Chapter 17: Examining Multiple Variable Values with Switch Blocks
Inserting DropBox and Label
Summary
Chapter 18: Improving Input Processing with TryParse
Inserting a button and a textbox
Summary
Chapter 19: Replacing If/Else Blocks with the Ternary Operator
Inserting two text boxes and a button
Summary
Chapter 20: Operators That Evaluate and Assign in Place
Inserting Button and Label
Summary
Chapter 21: Checking Two Conditions with the Logical AND Operator
Setting up the project
Summary
Chapter 22: Checking Two Conditions with the Logical OR Operator
Working with check boxes
Summary
Chapter 23: Declaring, Setting, and Reading Arrays
Setting up the basic interface
Summary
Chapter 24: Iterating Over Arrays with foreach and for Loops
Setting up the beginning interface
Summary
Chapter 25: Creating and Using a Simple Method
Setting up the user interface
Summary
Chapter 26: Passing Arrays into Methods
Setting up the user interface
Summary
Chapter 27: Reference Type and Value Type Variables
Setting up the user interface
Summary
Chapter 28: Creating More Flexible Methods with the params Keyword
Designing the starting markup
Summary
Chapter 29: Creating More Flexible Functions with the out Keyword
Setting up the beginning interface
Summary
Chapter 30: Combining the ref and out Keywords to Write Flexible Functions
Setting up the starting interface
Summary
Chapter 31: The out keyword in C# 7
Creating the program template
Writing the Summarize function
Implementing the function
Running the program
Chapter 32: Multidimensional Arrays
Understanding two-dimensional arrays
Summary
Chapter 33: Writing Easier Code with the Var and Dynamic Keywords
Setting up the project
Summary
Chapter 34: Creating a Class with a Constructor and a Function
Our initial markup
Summary
Chapter 35: Creating a Class with a Static Method
Setting up a simple initial interface
Summary
Chapter 36: Creating a Class with an Object Property
Setting up a simple markup page
Summary
Chapter 37: Creating a Class with Static Fields, Functions, and Properties
Setting up the interface for this project
Summary
Chapter 38: Centralizing Common Code with Inheritance
Setting up the interface for this lesson
Summary
Chapter 39: Centralizing Default Code with Virtual Functions
Setting up a basic HTML for this project
Summary
Chapter 40: Model Concepts with Abstract Classes
Introducing the basic HTML for this lesson's project
Summary
Chapter 41: Using Custom Types as Return Types
Setting up the project
Summary
Chapter 42: Using Lists to Operate on Data Efficiently
Summarizing the values in a list
Summary
Chapter 43: Writing Less Code with Polymorphism
Setting up the markup for this project
Summary
Chapter 44: Using Interfaces to Express Common Behaviors
Building a hierarchy
Summary
Chapter 45: Iterating over Instances with Indexers
Setting up a records project
Summary
Chapter 46: Building Stabler Apps with Exception Handling
Setting up the HTML for this chapter
Using a try block
Summary
Chapter 47: Using Named and Optional Parameters
Setting up the Book class
Summary
Chapter 48: Using the Null Coalescing Operator to Write Stabler Applications
Setting up the basic HTML for this project
Searching a database
Summary
Chapter 49: Overloading Operators to Perform Custom Operations
Creating a Vector class
Summary
Chapter 50: Using Enumerations to Represent Named Constants
Setting up a drop-down list
Summary
Chapter 51: Creating and Using Namespaces
Creating a new project with a new namespace
Summary
Chapter 52: Structs, Random Points, and Sleeping Threads
Adding a SimpleStruct class file
Coding the struct
Modifying the HTML to make use of the struct
Making an array of points
Displaying the results
Running the program
Debugging the program
Lesson review
Summary
Chapter 53: Declaring, Creating, and Using Delegates
Setting up the HTML for this project
Checking out the interface
Making a delegate
Running the program
Summary
Chapter 54: Switch Blocks with when
Creating the classes
Writing the Main function code
Running the program
Chapter 55: Switch Blocks with Objects in C# 7.0
Creating the interface
Implementing the interface
Creating the Main() program
Running the program
Chapter 56: Tuples
Creating the tuple function
Writing the Main() code
Running the program
Chapter 57: Local functions in C# 7.0
Creating the application and core functions
Creating the local function
Running the code
Chapter 58: Throwing Exceptions
Creating the main code
Running the program

What You Will Learn

  • Learn C#, Visual Studio, and object-oriented programming
  • Learn all the core C# language syntax with hands-on working examples
  • Learn everything from basic variable assignments to complex multidimensional arrays
  • Go through practical examples of all the core C# language features so that you can easily master them yourself
  • Use the C# programming language to work with code and data, which can be applied to other programming languages as well

Authors

Table of Contents

Chapter 1: Why C# and How to Download and Install the Visual Studio Community Edition
Locating and downloading the Visual Studio Community edition
Summary
Chapter 2: Customizing Visual Studio to Make it Feel More Personal
Customizing Visual Studio
Selecting the text editor font and size
Selecting the Statement Completion font and size
Selecting the Environment font and size
Positioning Visual Studio panels
Summary
Chapter 3: Creating and Running Your First Page
Starting a new project in Visual C#
Working with Solutions Explorer
Adding a document to your browser
Working with HTML code in Visual Studio
Launching the HTML code
Summary
Chapter 4: Creating and Running a Page That Incorporates C#
Improving your first program
Working in the Design view
Working in the Source view
Viewing the code in your browser
Summary
Chapter 5: Creating and Using a Single Variable
Setting up Visual C# to deal with a variable
Running the code
Summary
Chapter 6: String Interpolation and Updating Visual Studio
Selecting a NuGet package
Summary
Chapter 7: Formatting Output Strings for More Professional Results
Setting a value and formatting it as currency
Summary
Chapter 8: Using Variables and Data Types
Setting a page title automatically
Summary
Chapter 9: Computed Variables and Basic Math
Declaring and setting two variables to signify two different salaries
Summary
Chapter 10: Interacting with Users Through the Web Page
Using Toolbox to search for a command
Summary
Chapter 11: Using Method Chaining to Write More Compact Code
Inserting a text box into the markup
Summary
Chapter 12: Reacting to a Single Condition with If/Else Blocks
Adding checkbox to your code
Chapter 13: Making a Variable Grow by Adding 1
Growing a variable by one
Summary
Chapter 14: Repeating Blocks of Code with While Loops
Inserting a button
Summary
Chapter 15: Repeating Blocks of Code with For Loops
Inserting a button
Summary
Chapter 16: Iterating Over Collections with foreach Loops
Inserting TextBox
Summary
Chapter 17: Examining Multiple Variable Values with Switch Blocks
Inserting DropBox and Label
Summary
Chapter 18: Improving Input Processing with TryParse
Inserting a button and a textbox
Summary
Chapter 19: Replacing If/Else Blocks with the Ternary Operator
Inserting two text boxes and a button
Summary
Chapter 20: Operators That Evaluate and Assign in Place
Inserting Button and Label
Summary
Chapter 21: Checking Two Conditions with the Logical AND Operator
Setting up the project
Summary
Chapter 22: Checking Two Conditions with the Logical OR Operator
Working with check boxes
Summary
Chapter 23: Declaring, Setting, and Reading Arrays
Setting up the basic interface
Summary
Chapter 24: Iterating Over Arrays with foreach and for Loops
Setting up the beginning interface
Summary
Chapter 25: Creating and Using a Simple Method
Setting up the user interface
Summary
Chapter 26: Passing Arrays into Methods
Setting up the user interface
Summary
Chapter 27: Reference Type and Value Type Variables
Setting up the user interface
Summary
Chapter 28: Creating More Flexible Methods with the params Keyword
Designing the starting markup
Summary
Chapter 29: Creating More Flexible Functions with the out Keyword
Setting up the beginning interface
Summary
Chapter 30: Combining the ref and out Keywords to Write Flexible Functions
Setting up the starting interface
Summary
Chapter 31: The out keyword in C# 7
Creating the program template
Writing the Summarize function
Implementing the function
Running the program
Chapter 32: Multidimensional Arrays
Understanding two-dimensional arrays
Summary
Chapter 33: Writing Easier Code with the Var and Dynamic Keywords
Setting up the project
Summary
Chapter 34: Creating a Class with a Constructor and a Function
Our initial markup
Summary
Chapter 35: Creating a Class with a Static Method
Setting up a simple initial interface
Summary
Chapter 36: Creating a Class with an Object Property
Setting up a simple markup page
Summary
Chapter 37: Creating a Class with Static Fields, Functions, and Properties
Setting up the interface for this project
Summary
Chapter 38: Centralizing Common Code with Inheritance
Setting up the interface for this lesson
Summary
Chapter 39: Centralizing Default Code with Virtual Functions
Setting up a basic HTML for this project
Summary
Chapter 40: Model Concepts with Abstract Classes
Introducing the basic HTML for this lesson's project
Summary
Chapter 41: Using Custom Types as Return Types
Setting up the project
Summary
Chapter 42: Using Lists to Operate on Data Efficiently
Summarizing the values in a list
Summary
Chapter 43: Writing Less Code with Polymorphism
Setting up the markup for this project
Summary
Chapter 44: Using Interfaces to Express Common Behaviors
Building a hierarchy
Summary
Chapter 45: Iterating over Instances with Indexers
Setting up a records project
Summary
Chapter 46: Building Stabler Apps with Exception Handling
Setting up the HTML for this chapter
Using a try block
Summary
Chapter 47: Using Named and Optional Parameters
Setting up the Book class
Summary
Chapter 48: Using the Null Coalescing Operator to Write Stabler Applications
Setting up the basic HTML for this project
Searching a database
Summary
Chapter 49: Overloading Operators to Perform Custom Operations
Creating a Vector class
Summary
Chapter 50: Using Enumerations to Represent Named Constants
Setting up a drop-down list
Summary
Chapter 51: Creating and Using Namespaces
Creating a new project with a new namespace
Summary
Chapter 52: Structs, Random Points, and Sleeping Threads
Adding a SimpleStruct class file
Coding the struct
Modifying the HTML to make use of the struct
Making an array of points
Displaying the results
Running the program
Debugging the program
Lesson review
Summary
Chapter 53: Declaring, Creating, and Using Delegates
Setting up the HTML for this project
Checking out the interface
Making a delegate
Running the program
Summary
Chapter 54: Switch Blocks with when
Creating the classes
Writing the Main function code
Running the program
Chapter 55: Switch Blocks with Objects in C# 7.0
Creating the interface
Implementing the interface
Creating the Main() program
Running the program
Chapter 56: Tuples
Creating the tuple function
Writing the Main() code
Running the program
Chapter 57: Local functions in C# 7.0
Creating the application and core functions
Creating the local function
Running the code
Chapter 58: Throwing Exceptions
Creating the main code
Running the program

Book Details

ISBN 139781788296540
Paperback554 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

A 15 Hour C# 6.0 Course - The Core Language Book Cover
A 15 Hour C# 6.0 Course - The Core Language
$ 99.99
$ 85.00
Oracle SOA BPEL Process Manager 11gR1 – A Hands-on Tutorial Book Cover
Oracle SOA BPEL Process Manager 11gR1 – A Hands-on Tutorial
$ 32.99
$ 23.10
Getting Started with Oracle BPM Suite 11gR1 – A Hands-On Tutorial Book Cover
Getting Started with Oracle BPM Suite 11gR1 – A Hands-On Tutorial
$ 35.99
$ 25.20
The Ultimate Hands-on Hadoop [Video] Book Cover
The Ultimate Hands-on Hadoop [Video]
$ 179.99
$ 153.00
Getting Started with Oracle Data Integrator 11g: A Hands-On Tutorial Book Cover
Getting Started with Oracle Data Integrator 11g: A Hands-On Tutorial
$ 35.99
$ 25.20
Getting Started With Oracle SOA Suite 11g R1 - A Hands-On Tutorial Book Cover
Getting Started With Oracle SOA Suite 11g R1 - A Hands-On Tutorial
$ 35.99
$ 25.20