Get a running start to learning C# programming with this fun and easy-to-read guide

As one of the most versatile and powerful programming languages around, you might think C# would be an intimidating language to learn. It doesn't have to be!

In Beginning C# and .NET: 2021 Edition, expert Microsoft programmer and engineer Benjamin Perkins and program manager Jon D. Reid walk you through the precise, step-by-step directions you'll need to follow to become fluent in the C# language and .NET.

Using the proven WROX method, you'll discover how to understand and write simple expressions and functions, debug programs, work with classes and class members, work with Windows forms, program for the web, and access data. You'll even learn about some of the new features included in the latest releases of C# and .NET, including data consumption, code simplification, and performance.

The book also offers:

* Detailed discussions of programming basics, like variables, flow control, and object-oriented programming that assume no previous programming experience

* "Try it Out" sections to help you write useful programming code using the steps you've learned in the book

* Downloadable code examples from wrox.com

Perfect for beginning-level programmers who are completely new to C#, Beginning C# and .NET: 2021 Edition is a must-have resource for anyone interested in learning programming and looking for a fun and intuitive place to start.



Autorentext

About the authors

Benjamin Perkins is a Sr. Escalation Engineer at Microsoft. His experience includes designing, developing, deploying, administering, and managing enterprise-level IT solutions.

Jon D. Reid is a Program Manager in Research and Development at IFS AB, specializing in Field Service Management using C# and .NET.

Klappentext

Learn to program with the world's leading programming language

Ultra-versatile C# is the most popular programming language in the world, and this book is your ultimate beginner's guide to programming using the latest versions of C# and .NET. Even if you have never written a line of code, these expert Wrox authors will walk you through everything you need to know. You'll learn about variables, flow control, and object-oriented programming, then move into web and Windows programming as well as databases and XML. Exclusive Try It Out sections in the introductory chapters offer step-by-step instruction, enabling you to write your own usable code and build smarter, faster apps.

Beginning C# and .NET:

  • Introduces you to variables, expressions, flow control, functions, debugging, and error handling
  • Covers object-oriented programming, classes, class members, ASP.NET Core, WCF, REST API, and Blazor App programming techniques
  • Explains how enhancements such as code navigation, IntelliSense, refactoring, and code fixes save you programming time and effort
  • Provides plenty of downloadable code samples at wiley.com for your use
  • Shows you how to find and fix bugs early in the process, saving time and headaches later
  • Explores cloud, cross-platform, and data access programming

Wrox Beginning guides are crafted to make learning programming languages and technologies easier than you think, providing a structured, tutorial format that will guide you through all the techniques involved.

Zusammenfassung

Get a running start to learning C# programming with this fun and easy-to-read guide

As one of the most versatile and powerful programming languages around, you might think C# would be an intimidating language to learn. It doesn't have to be!

In Beginning C# and .NET: 2021 Edition, expert Microsoft programmer and engineer Benjamin Perkins and program manager Jon D. Reid walk you through the precise, step-by-step directions you'll need to follow to become fluent in the C# language and .NET.

Using the proven WROX method, you'll discover how to understand and write simple expressions and functions, debug programs, work with classes and class members, work with Windows forms, program for the web, and access data. You'll even learn about some of the new features included in the latest releases of C# and .NET, including data consumption, code simplification, and performance.

The book also offers:

  • Detailed discussions of programming basics, like variables, flow control, and object-oriented programming that assume no previous programming experience
  • Try it Out sections to help you write useful programming code using the steps you've learned in the book
  • Downloadable code examples from wrox.com

Perfect for beginning-level programmers who are completely new to C#, Beginning C# and .NET: 2021 Edition is a must-have resource for anyone interested in learning programming and looking for a fun and intuitive place to start.



Inhalt

Introduction xxvii

Part I: The C# Language

Chapter 1: Introducing C# 3

What Is .NET? 3

.NET Framework, .NET Standard, and .NET Core 4

Writing Programs Using .NET 5

CIL and JIT 5

Assemblies 6

Managed Code 7

Garbage Collection 7

Fitting It Together 7

Linking 8

What Is C#? 8

Applications You Can Write with C# 9

C# in This Book 10

Visual Studio 10

Visual Studio Products 10

Solutions 11

Chapter 2: Writing a C# Program 13

The Visual Studio Development Environment 14

Console Applications 18

The Solution Explorer 21

The Properties Window 22

The Error List Window 23

Desktop Applications 23

Chapter 3: Variables and Expressions 29

Basic C# Syntax 30

Basic C# Console Application Structure 33

Variables 34

Simple Types 34

Variable Naming 39

Literal Values 39

Binary Literals and Digit Separators 40

String Literals 41

Expressions 42

Mathematical Operators 43

Assignment Operators 48

Operator Precedence 49

Namespaces 50

Chapter 4: Flow Control 55

Boolean Logic 56

Boolean Bitwise and Assignment Operators 58

Operator Precedence Updated 60

Branching 60

The Ternary Operator 61

The if Statement 61

Checking More Conditions Using if Statements 64

The switch Statement 65

Looping 68

do Loops 68

while Loops 71

for Loops 73

Interrupting Loops 74

Infinite Loops 75

Chapter 5: More About Variables 79

Type Conversion 80

Implicit Conversions 80

Explicit Conversions 82

Explicit Conversions Using the Convert Commands 84

Complex Variable Types 87

Enumerations 87

Defining Enumerations 88

Structs 91

Defining Structs 92

Arrays 94

Declaring Arrays 95

foreach Loops 98

Pattern Matching with switch case Expression 98

Multidimensional Arrays 102

Arrays of Arrays 104

String Manipulation 105

Chapter 6: Functions 113

Defining and Using Functions 114

Return Values 117

Parameters 118

Parameter Matching 121

Parameter Arrays 121

Reference and Value Parameters 123

Out Parameters 125

Tuples 126

Variable Scope 128

Variable Scope in Other Structures 131

Parameters and Return Values versus Global Data 132

Local Functions 134

The Main() Function 135

Struct Functions 137

Overloading Functions 138

Using Delegates 140

Chapter 7: Debugging And Error Handling 145

Debugging in Visual Studio 146

Debugging in Nonbreak (Normal) Mod…

Titel
Beginning C# and .NET
EAN
9781119795834
Format
E-Book (epub)
Hersteller
Veröffentlichung
09.07.2021
Digitaler Kopierschutz
Adobe-DRM
Dateigrösse
26.7 MB
Anzahl Seiten
864