Details

C# 7.0 All-in-One For Dummies


C# 7.0 All-in-One For Dummies


1. Aufl.

von: John Paul Mueller, Bill Sempf, Chuck Sphar

32,99 €

Verlag: Wiley
Format: EPUB
Veröffentl.: 07.12.2017
ISBN/EAN: 9781119428107
Sprache: englisch
Anzahl Seiten: 864

DRM-geschütztes eBook, Sie benötigen z.B. Adobe Digital Editions und eine Adobe ID zum Lesen.

Beschreibungen

<b>Sharpen your knowledge of C#</b> <p>C# know-how is a must if you want to be a professional Microsoft developer. It's also good to know a little C# if you're building tools for the web, mobile apps, or other development tasks. <i>C# 7.0 All-in-One For Dummies</i> offers a deep dive into C# for coders still learning the nuances of the valuable programming language. Pop it open to get an intro into coding with C#, how to design secure apps and databases, and even pointers on building web and mobile apps with C#.</p> <p>C# remains one of the most in-demand programming language skills. The language regularly ranks in the top five among "most in-demand" languages, typically along with Java/JavaScript, C++, and Python. A December 2016 ZDNet article noted 'If your employer is a Microsoft developer, you better know C#." Lucky for you, this approachable, all-in-one guide is here to help you do just that—without ever breaking a sweat!</p> <p>Includes coverage of the latest changes to C#</p> <ul> <li>Shows you exactly what the language can (and can't) do</li> <li>Presents familiar tasks that you can accomplish with C#</li> <li>Provides insight into developing applications that provide protection against hackers</li> </ul> <p>If you have a basic understanding of coding and need to learn C#—or need a reference on the language in order to launch or further your career—look no further.</p>
<p><b>Introduction</b><b> 1</b></p> <p>About This Book 1</p> <p>Foolish Assumptions 2</p> <p>Icons Used in This Book 2</p> <p>Beyond the Book 3</p> <p>Where to Go from Here 4</p> <p><b>Book 1: The Basics of C# Programming</b><b> 5</b></p> <p><b>Chapter 1: Creating Your First C# Console Application</b><b> 7</b></p> <p>Getting a Handle on Computer Languages, C#, and .NET 7</p> <p>Creating Your First Console Application 11</p> <p>Making Your Console App Do Something 17</p> <p>Reviewing Your Console Application 18</p> <p>Introducing the Toolbox Trick 21</p> <p><b>Chapter 2: Living with Variability — Declaring Value-Type Variables</b><b> 23</b></p> <p>Declaring a Variable 24</p> <p>What’s an int? 25</p> <p>Representing Fractions 27</p> <p>Handling Floating-Point Variables 28</p> <p>Using the Decimal Type: Is it an Integer or a Float? 31</p> <p>Examining the bool Type: Is it Logical? 33</p> <p>Checking Out Character Types 33</p> <p>What’s a Value Type? 36</p> <p>Comparing string and char 37</p> <p>Calculating Leap Years: DateTime 38</p> <p>Declaring Numeric Constants 40</p> <p>Changing Types: The Cast 41</p> <p>Letting the C# Compiler Infer Data Types 42</p> <p><b>Chapter 3: Pulling Strings</b><b> 45</b></p> <p>The Union is Indivisible, and So are Strings 46</p> <p>Performing Common Operations on a String 48</p> <p>Comparing Strings 48</p> <p>What If I Want to Switch Case? 53</p> <p>Looping through a String 54</p> <p>Searching Strings 55</p> <p>Getting Input from the Command Line 57</p> <p>Controlling Output Manually 62</p> <p>Formatting Your Strings Precisely 68</p> <p>StringBuilder: Manipulating Strings More Efficiently 73</p> <p><b>Chapter 4: Smooth Operators</b><b> 75</b></p> <p>Performing Arithmetic 75</p> <p>Performing Logical Comparisons — Is That Logical? 79</p> <p>Matching Expression Types at TrackDownAMate.com 83</p> <p><b>Chapter 5: Getting into the Program Flow</b><b> 89</b></p> <p>Branching Out with if and switch 90</p> <p>Here We Go Loop-the-Loop 101</p> <p>Looping a Specified Number of Times with for 112</p> <p>Nesting Loops 115</p> <p>Don’t goto Pieces 116</p> <p><b>Chapter 6: Lining Up Your Ducks with Collections</b><b> 119</b></p> <p>The C# Array 120</p> <p>Processing Arrays by Using foreach 126</p> <p>Sorting Arrays of Data 128</p> <p>Using var for Arrays 132</p> <p>Loosening Up with C# Collections 133</p> <p>Understanding Collection Syntax 134</p> <p>Using Lists 136</p> <p>Using Dictionaries 139</p> <p>Array and Collection Initializers 141</p> <p>Using Sets 142</p> <p>On Not Using Old-Fashioned Collections 147</p> <p><b>Chapter 7: Stepping through Collections</b><b> 149</b></p> <p>Iterating through a Directory of Files 149</p> <p>Iterating foreach Collections: Iterators 157</p> <p>Accessing Collections the Array Way: Indexers 160</p> <p>Looping Around the Iterator Block 165</p> <p><b>Chapter 8: Buying Generic</b><b> 177</b></p> <p>Writing a New Prescription: Generics 178</p> <p>Classy Generics: Writing Your Own 179</p> <p>Revising Generics 197</p> <p><b>Chapter 9: Some Exceptional Exceptions</b><b> 201</b></p> <p>Using an Exceptional Error-Reporting Mechanism 202</p> <p>Throwing Exceptions Yourself 207</p> <p>Knowing What Exceptions are for 207</p> <p>Can I Get an Exceptional Example? 208</p> <p>Assigning Multiple catch Blocks 211</p> <p>Planning Your Exception-Handling Strategy 214</p> <p>Grabbing Your Last Chance to Catch an Exception 219</p> <p>Throwing Expressions 220</p> <p><b>Chapter 10: Creating Lists of Items with Enumerations</b><b> 223</b></p> <p>Seeing Enumerations in the Real World 224</p> <p>Working with Enumerations 225</p> <p>Creating Enumerated Flags 228</p> <p>Defining Enumerated Switches 230</p> <p><b>Book 2: Object-Oriented C# Programming</b><b> 233</b></p> <p><b>Chapter 1: Object-Oriented Programming — What’s it All About? </b><b>235</b></p> <p>Object-Oriented Concept #1: Abstraction 235</p> <p>Object-Oriented Concept #2: Classification 238</p> <p>Why Classify? 238</p> <p>Object-Oriented Concept #3: Usable Interfaces 239</p> <p>Object-Oriented Concept #4: Access Control 240</p> <p>How C# Supports Object-Oriented Concepts 241</p> <p><b>Chapter 2: Showing Some Class</b><b> 243</b></p> <p>Defining a Class and an Object 244</p> <p>Accessing the Members of an Object 246</p> <p>An Object-Based Program Example 247</p> <p>Discriminating between Objects 249</p> <p>Can You Give Me References? 249</p> <p>Classes That Contain Classes are the Happiest Classes in the World 252</p> <p>Generating Static in Class Members 253</p> <p>Defining const and readonly Data Members 255</p> <p><b>Chapter 3: We Have Our Methods</b><b> 257</b></p> <p>Defining and Using a Method 257</p> <p>A Method Example for Your Files 259</p> <p>Having Arguments with Methods 267</p> <p>Returning Values after Christmas 275</p> <p>Returning Multiple Values Using Tuples 279</p> <p><b>Chapter 4: Let Me Say This about this</b><b> 283</b></p> <p>Passing an Object to a Method 283</p> <p>Defining Methods 285</p> <p>Accessing the Current Object 290</p> <p>Using Local Functions 298</p> <p><b>Chapter 5: Holding a Class Responsible</b><b> 301</b></p> <p>Restricting Access to Class Members 301</p> <p>Why You Should Worry about Access Control 306</p> <p>Defining Class Properties 312</p> <p>Getting Your Objects Off to a Good Start — Constructors 315</p> <p>The C#-Provided Constructor 316</p> <p>Replacing the Default Constructor 317</p> <p>Using Expression-Bodied Members 324</p> <p><b>Chapter 6: Inheritance: Is That All I Get?</b><b> 329</b></p> <p>Class Inheritance 330</p> <p>Why You Need Inheritance 332</p> <p>Inheriting from a BankAccount Class (a More Complex Example) 333</p> <p>IS_A versus HAS_A — I’m So Confused_A 336</p> <p>When to IS_A and When to HAS_A 340</p> <p>Other Features That Support Inheritance 340</p> <p>The object Class 344</p> <p>Inheritance and the Constructor 345</p> <p>The Updated BankAccount Class 350</p> <p><b>Chapter 7: Poly-what-ism?</b><b> 357</b></p> <p>Overloading an Inherited Method 358</p> <p>Polymorphism 366</p> <p>The Class Business Card: ToString() 374</p> <p>C# During Its Abstract Period 374</p> <p>Sealing a Class 383</p> <p><b>Chapter 8: Interfacing with the Interface</b><b> 385</b></p> <p>Introducing CAN_BE_USED_AS 385</p> <p>Knowing What an Interface is 387</p> <p>Using an Interface 391</p> <p>Using the C# Predefined Interface Types 392</p> <p>Looking at a Program That CAN_BE_USED_AS an Example 393</p> <p>Unifying Class Hierarchies 401</p> <p>Hiding Behind an Interface 403</p> <p>Inheriting an Interface 406</p> <p>Using Interfaces to Manage Change in Object-Oriented Programs 407</p> <p><b>Chapter 9: Delegating Those Important Events</b><b> 411</b></p> <p>E.T., Phone Home — The Callback Problem 412</p> <p>Defining a Delegate 412</p> <p>Pass Me the Code, Please — Examples 414</p> <p>A More Real-World Example 417</p> <p>Shh! Keep it Quiet — Anonymous Methods 426</p> <p>Stuff Happens — C# Events 427</p> <p><b>Chapter 10: Can I Use Your Namespace in the Library? </b><b>435</b></p> <p>Dividing a Single Program into Multiple Source Files 436</p> <p>Dividing a Single Program into Multiple Assemblies 437</p> <p>Putting Your Classes into Class Libraries 440</p> <p>Going Beyond Public and Private: More Access Keywords 446</p> <p>Putting Classes into Namespaces 452</p> <p><b>Chapter 11: Improving Productivity with Named and Optional Parameters</b><b> 459</b></p> <p>Exploring Optional Parameters 460</p> <p>Looking at Named Parameters 464</p> <p>Dealing with Overload Resolution 465</p> <p>Using Alternative Methods to Return Values 466</p> <p><b>Chapter 12: Interacting with Structures</b><b> 469</b></p> <p>Comparing Structures to Classes 470</p> <p>Creating Structures 472</p> <p>Using Structures as Records 479</p> <p><b>Book 3: Designing for C#</b><b> 483</b></p> <p><b>Chapter 1: Writing Secure Code</b><b> 485</b></p> <p>Designing Secure Software 486</p> <p>Building Secure Windows Applications 488</p> <p>Building Secure Web Forms Applications 493</p> <p>Using System.Security 498</p> <p><b>Chapter 2: Accessing Data</b><b> 499</b></p> <p>Getting to Know System.Data 500</p> <p>How the Data Classes Fit into the Framework 502</p> <p>Getting to Your Data 502</p> <p>Using the System.Data Namespace 503</p> <p><b>Chapter 3: Fishing the File Stream</b><b> 521</b></p> <p>Going Where the Fish are: The File Stream 521</p> <p>StreamWriting for Old Walter 524</p> <p>Pulling Them Out of the Stream: Using StreamReader 536</p> <p>More Readers and Writers 540</p> <p>Exploring More Streams than Lewis and Clark 542</p> <p><b>Chapter 4: Accessing the Internet</b><b> 543</b></p> <p>Getting to Know System.Net 544</p> <p>How Net Classes Fit into the Framework 545</p> <p>Using the System.Net Namespace 547</p> <p><b>Chapter 5: Creating Images</b><b> 559</b></p> <p>Getting to Know System.Drawing 560</p> <p>How the Drawing Classes Fit into the Framework 563</p> <p>Using the System.Drawing Namespace 564</p> <p><b>Chapter 6: Programming Dynamically!</b><b> 571</b></p> <p>Shifting C# Toward Dynamic Typing 572</p> <p>Employing Dynamic Programming Techniques 574</p> <p>Putting Dynamic to Use 576</p> <p>Running with the Dynamic Language Runtime 579</p> <p><b>Book 4: A Tour of Visual Studio</b><b> 583</b></p> <p><b>Chapter 1: Getting Started with Visual Studio</b><b> 585</b></p> <p>Versioning the Versions 586</p> <p>Installing Visual Studio 590</p> <p>Breaking Down the Projects 592</p> <p><b>Chapter 2: Using the Interface</b><b> 597</b></p> <p>Designing in the Designer 597</p> <p>Paneling the Studio 605</p> <p>Coding in the Code Editor 612</p> <p>Using the Tools of the Trade 616</p> <p>Using the Debugger as an Aid to Learning 618</p> <p><b>Chapter 3: Customizing Visual Studio </b><b>623</b></p> <p>Setting Options 624</p> <p>Using Snippets 628</p> <p>Hacking the Project Types 634</p> <p><b>Book 5: Windows Development with WPF</b><b> 641</b></p> <p><b>Chapter 1: Introducing WPF</b><b> 643</b></p> <p>Understanding What WPF Can Do 643</p> <p>Introducing XAML 645</p> <p>Diving In! Creating Your First WPF Application 646</p> <p><b>Chapter 2: Understanding the Basics of WPF </b><b>653</b></p> <p>Using WPF to Lay Out Your Application 654</p> <p>Arranging Elements with Layout Panels 655</p> <p>Exploring Common XAML Controls 671</p> <p><b>Chapter 3: Data Binding in WPF</b><b> 681</b></p> <p>Getting to Know Dependency Properties 681</p> <p>Exploring the Binding Modes 682</p> <p>Investigating the Binding Object 683</p> <p>Editing, Validating, Converting, and Visualizing Your Data 687</p> <p>Finding Out More about WPF Data Binding 704</p> <p><b>Chapter 4: Practical WPF</b><b> 705</b></p> <p>Commanding Attention 705</p> <p>Using Built-In Commands 708</p> <p>Using Custom Commands 711</p> <p>Using Routed Commands 716</p> <p><b>Book 6: Web Development with ASP.NET</b><b> 721</b></p> <p><b>Chapter 1: Looking at How ASP.NET Works with C#</b><b> 723</b></p> <p>Breaking Down Web Applications 724</p> <p>Questioning the Client 726</p> <p>Dealing with Web Servers 730</p> <p><b>Chapter 2: Building Web Applications</b><b> 735</b></p> <p>Working in Visual Studio 736</p> <p>Developing with Style 749</p> <p><b>Chapter 3: Controlling Your Development Experience</b><b> 753</b></p> <p>Showing Stuff to the User 754</p> <p>Getting Some Input from the User 760</p> <p>Data Binding 767</p> <p>Styling Your Controls 775</p> <p>Making Sure the Site is Accessible 777</p> <p>Constructing User Controls 779</p> <p><b>Chapter 4: Leveraging the .NET Framework</b><b> 783</b></p> <p>Surfing Web Streams 784</p> <p>Securing ASP.NET 789</p> <p>Managing Files 791</p> <p>Baking Cookies 792</p> <p>Tracing with TraceContext 796</p> <p>Navigating with Site Maps 798</p> <p>Index 801</p>
<p><b>John Paul Mueller</b> is a writer on programming topics like AWS, Python, Java, HTML, CSS, and JavaScript. <b>William Sempf</b> is a programmer and .NET evangelist. <b>Chuck Sphar</b> was a full-time senior technical writer for the Visual C++ product group at Microsoft.
<p><b>6 Books in one!</b> <p><b>Sharpen your knowledge of C#</b> <p>C# know-how is a must if you want to be a professional developer and especially if you plan to work on Microsoft products. No matter where your skills lie, this book offers a deep dive into C# for coders who need an overview of the nuances of this valuable programming language. Pop it open to get an intro into coding with C#, how to design secure apps and databases, and even pointers on building web apps with C#. <p><b>Inside…</b> <ul> <li>The Basics of C# Programming</li> <li>Object-Oriented C# Programming</li> <li>Designing for C#</li> <li>A Tour of Visual Studio<sup>®</sup></li> <li>Windows Development with WPF</li> <li>Web Development with ASP.NET</li> </ul>

Diese Produkte könnten Sie auch interessieren:

Domain Architectures
Domain Architectures
von: Daniel J. Duffy
PDF ebook
31,99 €