Copyrighted Material

Total Page:16

File Type:pdf, Size:1020Kb

Copyrighted Material Contents Acknowledgments xiii Introduction xlvii Part I: The C# Language 1 Chapter 1: .NET Architecture 3 The Relationship of C# to .NET 4 The Common Language Runtime 4 Platform Independence 4 Performance Improvement 4 Language Interoperability 5 A Closer Look at Intermediate Language 7 Support for Object Orientation and Interfaces 7 Distinct Value and Reference Types 8 Strong Data Typing 8 Error Handling with Exceptions 14 Use of Attributes 15 Assemblies 15 Private Assemblies 16 Shared Assemblies 16 Reflection 17 .NET Framework Classes 17 Namespaces 18 Creating .NET Applications Using C# 19 Creating ASP .NET Applications 19 Creating WindowsCOPYRIGHTED Forms MATERIAL 21 Using the Windows Presentation Foundation (WPF) 21 Windows Controls 21 Windows Services 21 Windows Communication Foundation (WCF) 22 The Role of C# in the .NET Enterprise Architecture 22 Summary 23 fftoc.inddtoc.indd xxvv 22/19/08/19/08 88:30:27:30:27 PPMM Contents Chapter 2: C# Basics 25 Before We Start 25 Your First C# Program 26 The Code 26 Compiling and Running the Program 26 A Closer Look 27 Variables 29 Initialization of Variables 29 Type Inference 30 Variable Scope 31 Constants 34 Predefined Data Types 34 Value Types and Reference Types 35 CTS Types 36 Predefined Value Types 36 Predefined Reference Types 40 Flow Control 42 Conditional Statements 42 Loops 45 Jump Statements 49 Enumerations 50 Arrays 51 Namespaces 52 The using Directive 53 Namespace Aliases 54 The Main() Method 55 Multiple Main() Methods 55 Passing Arguments to Main() 56 More on Compiling C# Files 57 Console I/O 58 Using Comments 60 Internal Comments within the Source Files 60 XML Documentation 61 The C# Preprocessor Directives 63 #define and #undef 63 #if, #elif, #else, and #endif 64 #warning and #error 65 #region and #endregion 65 #line 65 #pragma 66 C# Programming Guidelines 66 xvi fftoc.inddtoc.indd xxvivi 22/19/08/19/08 88:30:28:30:28 PPMM Contents Rules for Identifiers 66 Usage Conventions 67 Summary 73 Chapter 3: Objects and Types 75 Classes and Structs 76 Class Members 76 Data Members 77 Function Members 77 Anonymous Types 91 Structs 92 Structs Are Value Types 93 Structs and Inheritance 94 Constructors for Structs 94 Partial Classes 95 Static Classes 96 The Object Class 97 System.Object Methods 97 The ToString() Method 98 Extension Methods 99 Summary 100 Chapter 4: Inheritance 101 Types of Inheritance 101 Implementation versus Interface Inheritance 101 Multiple Inheritance 102 Structs and Classes 102 Implementation Inheritance 103 Virtual Methods 104 Hiding Methods 104 Calling Base Versions of Functions 106 Abstract Classes and Functions 106 Sealed Classes and Methods 107 Constructors of Derived Classes 107 Modifiers 112 Visibility Modifiers 112 Other Modifiers 113 Interfaces 114 Defining and Implementing Interfaces 115 Derived Interfaces 118 Summary 120 xvii fftoc.inddtoc.indd xxviivii 22/19/08/19/08 88:30:29:30:29 PPMM Contents Chapter 5: Arrays 121 Simple Arrays 121 Array Declaration 121 Array Initialization 122 Accessing Array Elements 123 Using Reference Types 123 Multidimensional Arrays 125 Jagged Arrays 126 Array Class 127 Properties 127 Creating Arrays 127 Copying Arrays 128 Sorting 129 Array and Collection Interfaces 132 IEnumerable 132 ICollection 132 IList 132 Enumerations 133 IEnumerator Interface 134 foreach Statement 134 yield Statement 134 Summary 139 Chapter 6: Operators and Casts 141 Operators 141 Operator Shortcuts 143 The Conditional Operator 144 The checked and unchecked Operators 145 The is Operator 146 The as Operator 146 The sizeof Operator 146 The typeof Operator 146 Nullable Types and Operators 147 The Null Coalescing Operator 147 Operator Precedence 147 Type Safety 148 Type Conversions 149 Boxing and Unboxing 152 Comparing Objects for Equality 153 Comparing Reference Types for Equality 153 Comparing Value Types for Equality 154 xviii fftoc.inddtoc.indd xxviiiviii 22/19/08/19/08 88:30:29:30:29 PPMM Contents Operator Overloading 155 How Operators Work 156 Operator Overloading Example: The Vector Struct 157 Which Operators Can You Overload? 163 User-Defined Casts 164 Implementing User-Defined Casts 165 Multiple Casting 171 Summary 175 Chapter 7: Delegates and Events 177 Delegates 177 Declaring Delegates in C# 178 Using Delegates in C# 179 Simple Delegate Example 182 BubbleSorter Example 184 Multicast Delegates 187 Anonymous Methods 190 Lambda Expressions 191 Covariance and Contra-variance 193 Events 194 The Receiver’s View of Events 195 Defining Events 197 Summary 201 Chapter 8: Strings and Regular Expressions 203 System.String 204 Building Strings 205 StringBuilder Members 208 Format Strings 209 Regular Expressions 214 Introduction to Regular Expressions 215 The RegularExpressionsPlayground Example 216 Displaying Results 219 Matches, Groups, and Captures 220 Summary 222 Chapter 9: Generics 223 Overview 223 Performance 224 Type Safety 225 xix fftoc.inddtoc.indd xxixix 22/19/08/19/08 88:30:30:30:30 PPMM Contents Binary Code Reuse 225 Code Bloat 226 Naming Guidelines 226 Creating Generic Classes 226 Generic Classes’ Features 231 Default Values 231 Constraints 232 Inheritance 234 Static Members 235 Generic Interfaces 235 Generic Methods 236 Generic Delegates 238 Implementing Methods Called by Delegates 238 Using Generic Delegates with the Array Class 240 Other Generic Framework Types 243 Nullable<T> 243 EventHandler<TEventArgs> 244 ArraySegment<T> 245 Summary 246 Chapter 10: Collections 247 Collection Interfaces and Types 247 Lists 250 Creating Lists 252 Read-Only Collections 261 Queues 261 Stacks 266 Linked Lists 268 Sorted Lists 275 Dictionaries 278 Key Type 278 Dictionary Example 280 Lookup 283 Other Dictionary Classes 284 HashSet 286 Bit Arrays 289 BitArray 289 BitVector32 291 Performance 294 Summary 296 xx fftoc.inddtoc.indd xxxx 22/19/08/19/08 88:30:30:30:30 PPMM Contents Chapter 11: Language Integrated Query 297 LINQ Overview 297 Query using List<T> 298 Extension Methods 304 Lambda Expressions 306 LINQ Query 307 Deferred Query Execution 307 Standard Query Operators 309 Filtering 311 Filtering with Index 312 Type Filtering 312 Compound from 313 Sorting 314 Grouping 315 Grouping with Nested Objects 316 Join 317 Set Operations 318 Partitioning 319 Aggregate Operators 321 Conversion 322 Generation Operators 323 Expression Trees 324 LINQ Providers 327 Summary 328 Chapter 12: Memory Management and Pointers 329 Memory Management Under the Hood 329 Value Data Types 330 Reference Data Types 331 Garbage Collection 333 Freeing Unmanaged Resources 334 Destructors 335 The IDisposable Interface 336 Implementing IDisposable and a Destructor 337 Unsafe Code 339 Accessing Memory Directly with Pointers 339 Pointer Example: PointerPlayaround 347 Using Pointers to Optimize Performance 352 Summary 355 xxi fftoc.inddtoc.indd xxxixi 22/19/08/19/08 88:30:30:30:30 PPMM Contents Chapter 13: Reflection 357 Custom Attributes 358 Writing Custom Attributes 358 Custom Attribute Example: WhatsNewAttributes 362 Reflection 365 The System.Type Class 365 The TypeView Example 367 The Assembly Class 370 Completing the WhatsNewAttributes Example 371 Summary 376 Chapter 14: Errors and Exceptions 377 Exception Classes 378 Catching Exceptions 379 Implementing Multiple Catch Blocks 382 Catching Exceptions from Other Code 385 System.Exception Properties 386 What Happens If an Exception Isn’t Handled? 386 Nested try Blocks 387 User-Defined Exception Classes 389 Catching the User-Defined Exceptions 390 Throwing the User-Defined Exceptions 391 Defining the User-Defined Exception Classes 394 Summary 397 Part II: Visual Studio 399 Chapter 15: Visual Studio 2008 401 Working with Visual Studio 2008 401 Creating a Project 406 Solutions and Projects 412 Windows Application Code 415 Reading in Visual Studio 6 Projects 416 Exploring and Coding a Project 416 Building a Project 427 Debugging 430 Refactoring 434 Multi-Targeting 436 WPF, WCF, WF, and More 438 xxii fftoc.inddtoc.indd xxxiixii 22/19/08/19/08 88:30:31:30:31 PPMM Contents Building WPF Applications in Visual Studio 438 Building WF Applications in Visual Studio 439 Summary 441 Chapter 16: Deployment 443 Designing for Deployment 443 Deployment Options 444 Xcopy 444 Copy Web Tool 444 Publishing Web Sites 444 Deployment Projects 444 ClickOnce 444 Deployment Requirements 444 Deploying the .NET Runtime 446 Simple Deployment 446 Xcopy 447 Xcopy and Web Applications 447 Copy Web Tool 447 Publishing a Web Site 447 Installer Projects 448 What Is Windows Installer? 449 Creating Installers 449 ClickOnce 458 ClickOnce Operation 458 Publishing an Application 459 ClickOnce Settings 459 Application Cache 460 Security 460 Advanced Options 460 Summary 466 Part III: Base Class Libraries 467 Chapter 17: Assemblies 469 What Are Assemblies? 469 Features of Assemblies 470 Assembly Structure 470 Assembly Manifests 472 Namespaces, Assemblies, and Components 472 Private and Shared Assemblies 472 xxiii fftoc.inddtoc.indd xxxiiixiii 22/19/08/19/08 88:30:31:30:31 PPMM Contents Satellite Assemblies 473 Viewing Assemblies 473 Creating Assemblies 474 Creating Modules and Assemblies 474 Assembly Attributes 475 Dynamic Loading and Creating Assemblies 478 Application Domains 481 Shared Assemblies 485 Strong Names 486 Integrity Using Strong Names 486 Global Assembly Cache 487 Creating a Shared Assembly 489 Create a Strong Name 489 Install the Shared Assembly 491 Using the Shared Assembly 491 Delayed Signing of Assemblies 492 References 493 Native Image Generator 494 Configuring .NET Applications 495 Configuration Categories 496 Configuring Directories for Assembly Searches 497
Recommended publications
  • Middleware in Action 2007
    Technology Assessment from Ken North Computing, LLC Middleware in Action Industrial Strength Data Access May 2007 Middleware in Action: Industrial Strength Data Access Table of Contents 1.0 Introduction ............................................................................................................. 2 Mature Technology .........................................................................................................3 Scalability, Interoperability, High Availability ...................................................................5 Components, XML and Services-Oriented Architecture..................................................6 Best-of-Breed Middleware...............................................................................................7 Pay Now or Pay Later .....................................................................................................7 2.0 Architectures for Distributed Computing.................................................................. 8 2.1 Leveraging Infrastructure ........................................................................................ 8 2.2 Multi-Tier, N-Tier Architecture ................................................................................. 9 2.3 Persistence, Client-Server Databases, Distributed Data ....................................... 10 Client-Server SQL Processing ......................................................................................10 Client Libraries ..............................................................................................................
    [Show full text]
  • Portable Microsoft Visual Foxpro 9 SP2 Serial Key Keygen
    Portable Microsoft Visual FoxPro 9 SP2 Serial Key Keygen 1 / 4 Portable Microsoft Visual FoxPro 9 SP2 Serial Key Keygen 2 / 4 3 / 4 License · Commercial proprietary software. Website, msdn.microsoft.com/vfoxpro. Visual FoxPro is a discontinued Microsoft data-centric procedural programming language that ... As of March 2008, all xBase components of the VFP 9 SP2 (including Sedna) were ... CLR Profiler · ILAsm · Native Image Generator · XAMLPad .... Download Microsoft Visual FoxPro 9 SP1 Portable Edition . Download ... Visual FoxPro 9 Serial Number Keygen for All Versions. 9. 0. SP2.. Download Full Cracked Programs, license key, serial key, keygen, activator, ... Free download the full version of the Microsoft Visual FoxPro 9 Windows and Mac. ... 9 Portable, Microsoft Visual FoxPro 9 serial number, Microsoft Visual FoxPro 9 .... Download Microsoft Visual FoxPro 9 SP 2 Full. Here I provide two ... Portable and I include file . 2015 Free ... Visual FoxPro 9.0 SP2 provides the latest updates to Visual FoxPro. ... autodesk autocad 2010 keygens only x force 32bits rh.. ... cs5 extended serial number keygen photo dvd slideshow professional 8.23 serial ... canadian foreign policy adobe acrobat 9 standard updates microsoft money ... microsoft visual studio express 2012 for web publish website microsoft office ... illustrator cs5 portable indowebsteradobe illustrator cs6 portable indowebster .... Download Microsoft Visual FoxPro 9 SP 2 Full Intaller maupun Portable. ... serial number Visual FoxPro 9 SP2 Portable, keygen Visual FoxPro 9 SP2 Portable, .... Microsoft Visual FoxPro 9.0 Service Pack 2.0. Important! Selecting a language below will dynamically change the complete page content to that .... Microsoft Visual FoxPro all versions serial number and keygen, Microsoft Visual FoxPro serial number, Microsoft Visual FoxPro keygen, Microsoft Visual FoxPro crack, Microsoft Visual FoxPro activation key, ..
    [Show full text]
  • Ideas on Advanced Runtime Encryption of .NET Executables Christian Ammann
    Ideas on advanced runtime Encryption of .NET Executables Christian Ammann December 13, 2012 Nullsecurity team Encryption of .NET Executables 1 Introduction Runtime crypter accepts binary executable files as input and transforms them into an encrypted version (preserving its original behaviour). The encrypted file decrypts itself on startup and executes it’s original content. This approach allows the deployment of malicious executables in protected environments: As pattern based anti virus (AV) solution detects the signature of suspicious files and blocks their execution. The encrypted counterpart contains an unknown signature, it’s content can not be analysed by heuristics and is therefore executed normally without an intervention by the AV scanner. We presented in our last paper [1] the theoretic aspects of runtime PE [2] encryption and a reference implementation called Hyperion. Hyperion generates a random key and uses it to en- crypt the input file with AES-128 [3]. The encrypted file decrypts itself upon startup bruteforcing the necessary key. Therefore no AES key is stored inside the file which makes it hard for an anti virus solution to detect the encrypted payload. However, one major aspect is still missing: Hyperion encrypts only regular portable executables and support for .NET [4] byte code (which is used by Microsoft in C# [5], J# [6] and visual basic [7] applications) has to be implemented. Therefore, this paper reveals the aspects of .NET runtime encryption and presents a proof of concept implementation for Hyperion. It has the following structure: Section 2 describes the basic layout of .NET executables and their integration in native PE files.
    [Show full text]
  • C# 5.0 Unleashed Editor-In-Chief Copyright © 2013 by Pearson Education, Inc
    Contents i Bart De Smet C # 5.0 UNLEASHED 800 East 96th Street, Indianapolis, Indiana 46240 USA C# 5.0 Unleashed Editor-in-Chief Copyright © 2013 by Pearson Education, Inc. Greg Wiegand All rights reserved. No part of this book shall be reproduced, stored in a retrieval Acquisitions Editor system, or transmitted by any means, electronic, mechanical, photocopying, record- Neil Rowe ing, or otherwise, without written permission from the publisher. No patent liability is assumed with respect to the use of the information contained herein. Although every Development Editor precaution has been taken in the preparation of this book, the publisher and author Mark Renfrow assume no responsibility for errors or omissions. Nor is any liability assumed for damages resulting from the use of the information contained herein. Managing Editor ISBN-13: 978-0-672-33690-4 Kristy Hart ISBN-10: 0-672-33690-1 Project Editor Andy Beaster Library of Congress Cataloging-in-Publication Data is on file. Printed in the United States of America Copy Editor Keith Cline First Printing: April 2013 Trademarks Indexer Brad Herriman All terms mentioned in this book that are known be trademarks or service marks have been appropriately capitalized. Sams Publishing cannot attest to the accuracy of this Proofreader information. Use of a term in this book should not be regarded as affecting the validity Debbie Williams of any trademark or service mark. Technical Editor Warning and Disclaimer Christopher Wilcox Every effort has been made to make this book as complete and as accurate as possible, but no warranty or fitness is implied.
    [Show full text]
  • Microsoft Visual Studio Ja C# Saateks Selle Teksti Kirjutamise Üks Eesmärk on Olnud Oma Seniste Kogemuste Ja Teadmiste Korrastami- Ne
    Kalle Remm Visual Studio ja programmeerimiskeel C# Versioon 10.12.2019 Microsoft Visual Studio ja C# Saateks Selle teksti kirjutamise üks eesmärk on olnud oma seniste kogemuste ja teadmiste korrastami- ne. Oleks meeldiv, kui sellest oleks õppevahendina abi ka kellelgi teisel. Õppevahend sisaldab üle- vaadet C# keelest, juhiseid MS Visual Studio (VS) kasutamiseks ja erinevat tüüpi tarkvaraliste raken- duste loomiseks VS keskkonnas. Näiteks klassikalised Windows vormid, veebilahendused, veebi- teenused, WCF teenused, WPF rakendused ja universaalsed Windows 10 äpid. Tekstis kasutatud lühendite ja mõistete tähendust vaata jaotusest Mõisted. Kronoloogiline ülevaade selles õppe- vahendis käsitletud peamistest tehnoloogiatest on lisas 1 esitatud joonisel. See õppevahend ei ole inglise keeles, sest inglisekeelset kirjandust on veebis niigi palju. Programmeerimiskeel C# ja VS võimaldavad professionaalsel tasemel tööd, kuid see tekstis on püütud vältida peensusi, milleta algaja hakkama saab. Õppevahend ei eelda eelteadmisi programmeerimisest, küll aga huvi ja süvenemiseks tarvilikku aega. Ka selle teksti koostaja ei ole ise osalenud ühelgi programmeerimise kursusel. Algteadmises infotehnoloogiast ja andmebaaside ülesehitusest on siiski abiks. Visual Studio ja .NET raamistiku tehnoloogiad on väga mahukad ja mitmekülgsed. Ka programmeerimiskeele üksikasjade selgeks saamine võtab aega. Ära lase end sellest heidutada. Võid alustada ka harjutustega, nende juurde kuuluva näidiskoodi ja selgitustega. Algul on olulisim saada kogemus, kuidas asjad toimivad. Sellel teksti lõpus ei ole viidatud kirjanduse loetelu, sest valdavalt on kasutatud veebiallikaid ja viited nendele on hüperlinkidena tekstis. Kui õnnestus kindlaks teha veebiallika (esimene) autor, siis on viidatud tema nime abil, ka siis, kui tegemist on firma nimel avaldatud dokumendiga. See tekst sisaldab üle 600 viite välisele allikale. C# keele kasutamise näited on püütud koostada võimalikult lihtsad ja lühikesed, enamik näiteid toimivad lihtsates konsoolirakendustes.
    [Show full text]
  • Smart Client Architecture and Design Guide
    Smart Client Architecture and Design Guide Foreword by Mark Boulter Smart Client Architecture and Design Guide patterns & practices David Hill, Microsoft Corporation Brenton Webster, Microsoft Corporation Edward A. Jezierski, Microsoft Corporation Srinath Vasireddy, Microsoft Corporation Mo Al-Sabt, Microsoft Corporation Blaine Wastell, Ascentium Corporation Jonathan Rasmusson, ThoughtWorks Paul Gale, ThoughtWorks Paul Slater, Wadeware LLC Information in this document, including URL and other Internet Web site references, is subject to change without notice. Unless otherwise noted, the example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious, and no association with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation. Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property. © 2004 Microsoft Corporation. All rights reserved. Microsoft, MS-DOS, Windows, Windows NT, Windows Server, Active Directory, BizTalk, InfoPath, MSDN, Outlook, Visual Basic, Visual C++, Visual C#, Visual Studio, and Win32 are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.
    [Show full text]
  • NET Framework Interview Questions You’Ll Most Likely Be Asked
    .NET Interview Questions You'll Most Likely Be Asked Job Interview Questions Series .NET Interview Questions You'll Most Likely Be Asked © 2015, By Vibrant Publishers, USA. All rights reserved. No part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior permission of the publisher. ISBN 10: 1453765662 EAN-13: 9781453765661 This publication is designed to provide accurate and authoritative information in regard to the subject matter covered. The author has made every effort in the preparation of this book to ensure the accuracy of the information. However, information in this book is sold without warranty either expressed or implied. The Author or the Publisher will not be liable for any damages caused or alleged to be caused either directly or indirectly by this book. Vibrant Publishers books are available at special quantity discount for sales promotions, or for use in corporate training programs. For more information please write to [email protected] Please email feedback / corrections (technical, grammatical or spelling) to [email protected] To access the complete catalogue of Vibrant Publishers, visit www.vibrantpublishers.com Table of Contents 1 VB.NET 7 2 ASP.NET 23 3 C#.NET 43 4 .NET Framework 59 5 Multiple Choice Questions VB.NET 75 6 Multiple Choice Questions ASP.NET 83 7 Multiple Choice Questions C#.NET 93 8 Multiple Choice Questions .NET Framework 101 9 HR Questions 109 INDEX 132 This page is intentionally left blank .NET Framework Interview Questions Review these typical interview questions and think about how you would answer them.
    [Show full text]
  • C#-Performancetuning
    C#-Performancetuning Rainer Stropek | timecockpit Your Host Rainer Stropek Developer, Entrepreneur Azure MVP, MS Regional Director Contact software architects gmbh [email protected] Twitter: @rstropek Agenda (German) Der Code ist fertig, die Kunden beschweren sich über schlechte Performance. Was nun? In dieser zweiteiligen Session zeigt Rainer Stropek Wege aus solchen Krisen. Im ersten Teil erarbeiten wir die Grundlagen. • Was beeinflusst die Performance von .NET-Anwendungen? • Welche Mythen gibt es, die man getrost vergessen kann? • Warum beeinflussen JIT und Garbage Collector die Performance so stark? • Wie bereitet man Performanceprofiling richtig vor? • Welche grundlegenden Techniken gibt es dafür? Solche und ähnliche Fragen sind Thema der Session. Im zweiten Teil gehts ins Detail. Rainer zeigt anhand praktischer Beispiele, wie man Tools in und um Visual Studio verwendet, um Performancekillern auf die Spur zu kommen. Sie lernen unter anderem die Profiling-Tools von Visual Studio und das Microsoft-Werkzeug PerfView kennen. Exemplarisch wird Rainer in der Session auch Unterschiede zu kommerziellen Profiling-Werkzeugen demonstrieren. Why Optimizing? Examples … Customer satisfaction Customers report performance problems Reduce churn rate Tip: Ask you users if they are leaving because of poor performance Raise conversion rate Consider the first impression potential users have from your software Tip: Ask your users why they are not buying Reduce TCO of your application Performance problems waste your user’s time = money Reduce TCO
    [Show full text]
  • Unit I - Visual Basic .Net and Frame Work
    UNIT I - VISUAL BASIC .NET AND FRAME WORK The Common Type System- The Common Language Specification- The Common Language Runtime -Microsoft Intermediate Language- Metadata- Executable Code-Managed Execution- Side−by−Side Execution- Understanding Assemblies- Assembly- - Strong Names Introduction to Visual Basic .NET Development environment. COMMON TYPE SYSTEM A key piece of functionality that enables Multiple Language Support is a Common Type System, in which all commonly used data types, even base types such as Longs and Booleans are actually implemented as objects. Since all languages are using the same library of types, calling one language from another doesn't require type conversion or weird calling conventions. For example, what we called an Integer in VB6 and earlier, is now known as a Short in Visual Basic.NET. The common type system defines how types are declared, used, and managed in the runtime, and is also an important part of the runtime's support for cross-language integration. The common type system performs the following functions: Establishes a framework that helps enable cross-language integration, type safety, and high performance code execution. Provides an object-oriented model that supports the complete implementation of many programming languages. Defines rules that languages must follow, which helps ensure that objects written in different languages can interact with each other. THE COMMON LANGUAGE SPECIFICATION Languages that fit into.NET must satisfy the Common Language Specification (CLS), which sets the constraints the languages must meet. If a language adheres to this spec, it gets an appropriate level of language interoperability. There are actually three categories of compliance to the CLS that .NET languages can subscribe to.
    [Show full text]
  • ASP.NET in 60 Minutes a Day
    b 430234 FM.qxd 7/1/03 8:58 AM Page iii ASP.NET in 60 Minutes a Day Glenn Johnson b 430234 FM.qxd 7/1/03 8:58 AM Page ix Contents Acknowledgments xxiii About the Author xxv Introduction xxvii Chapter 1 Introducing ASP.NET 1 Problems with Older Versions of Active Server Pages 2 The Benefits of ASP.NET 2 What Language Should Be Used? 3 Choosing the Appropriate Development Environment 6 The Operating System 6 The Database Server 6 The Version Control Software 7 The Visual Studio .NET Edition 7 Visual Studio .NET Professional Edition 7 Visual Studio .NET Enterprise Developer Edition 8 Visual Studio .NET Enterprise Architect Edition Contents 8 Software Selection Conclusions 9 The Software Installation Location 9 Developer Permission Assignments 10 Setting up the Development Environment 11 Installing Windows 11 Configuring Internet Information Server 11 Other Software 11 Installing SQL Server 2000 Developer Edition 12 Creating the SQL Server Service Account 13 SQL Server Installation 13 Adding a SQL Server Login for Your Use 15 SQL Server Stored Procedure Debugging 16 Installing Visual Studio .NET 18 Installing Visual SourceSafe Server 19 ix b 430234 FM.qxd 7/1/03 8:58 AM Page x x Contents Installing Visual SourceSafe Client 19 Windows 2000 Administration 20 Visual SourceSafe Administration 21 Summary 30 Chapter 2 Solutions, Projects, and the Visual Studio .NET IDE 33 Planning and Creating the Visual Studio .NET Solution Structure 33 Folder Structure 34 Virtual Directory Creation 35 Virtual Directory via Web Sharing 35 Virtual Directory via
    [Show full text]
  • NET Overview Objectives
    .NET Overview Objectives • Introduce .NET –overview – languages –libraries – development and execution model • Examine simple C# program 2 .NET Overview • .NET is a sweeping marketing term for a family of products – development tools and languages –platform – application management servers – value-added services development platform servers services Languages Common Language Runtime SQL Server My Services Compilers Framework Libraries BizTalk Alerts Visual Studio .NET SharePoint Passport ... ... 3 Evolution of the platform • .NET is the next evolutionary step for the Microsoft platform – new languages largely replace classic C++ and Visual Basic – new runtime model reduces need for COM style integration – XML web services used in place of DCOM – Windows Forms replace MFC – ASP.NET improves on ASP –etc. 4 Software development • .NET software development and execution has many actors – languages –libraries – compilers – intermediate language – execution engine 5 Languages • Many .NET programming languages available –C# –VB.NET – C++ –etc. • Language choice typically based on many factors – programmer background – problem domain – language features – corporate mandate 6 Language power • All languages can access .NET infrastructure class Hello { static void Main() { C# System.Console.WriteLine("hello"); } } Class Goodbye Shared Sub Main() VB.NET System.Console.WriteLine("goodbye") End Sub End Class 7 Language interoperability • All .NET languages can interoperate class Hello { static void Main() C# calling { System.Console.WriteLine(Greeting.Message());
    [Show full text]
  • Net Wprowadzenie
    .NET WPROWADZENIE Dr hab. inż. Krzysztof Zatwarnicki, prof. PO Wprowadzenie • Co to jest .NET Framework • Microsoft Visual C# .NET Framework • Środowisko do budowania i kompilowania aplikacji • Wspólne Środowisko Uruchomieniowe CLR(Common Language Runtime ) Common language runtime • Każdy język podlegający specjalizacji CLS (Common Language Specification) może zostać uruchomiony w CLR. • Aplikacje mogą być napisane w różnych językach programowania i nadal ze sobą współpracować Common Language Specification W .NET Framework Microsoft daje możliwość współpracy między następującymi językami: • Microsoft Visual Basic • Microsoft Visual C# • Microsoft Visual C++ • Microsoft J# Uwzględnia się również możliwość współpracy z innymi językami (według Microsoft jest to około 20 języków) Visual C# .NET • C# to jedyny język programowania Microsoft, który został zaprojektowany od samego początku specjalnie dla platformy .NET i wspólnego środowiska uruchomieniowego CLR. Chociaż CLR obsługuje wiele języków, to tylko C# był projektowany równolegle z CLR. Te dwie technologie miały na siebie duży wpływ, przez co C# świetnie nadaje się do pisania kodu zarządzanego. Kod zarządzany komponentów platformy .NET, takich jak biblioteki klas i środowisko programistyczne ASP.NET, został napisany właśnie w języku C#. • C# jest znacznie prostszym językiem niż C++, jednak — jak sama nazwa wskazuje — należy do rodziny języków C. Oznacza to, że ma wiele cech wspólnych z C/C++, których nie mają języki takie jak Visual Basic. Na przykład C# rozróżnia wielkie i małe litery, a VB nie. C# wymaga od programistów jawnej konwersji pomiędzy typami danych, a Visual Basic dokonuje niektórych konwersji automatycznie. Składnia języka C# jest podobna do składni języków C++ i Java. C# ma jednak w stosunku do C++ kilka dodatkowych cech obiektowych, takich jak właściwości, atrybuty, delegaty czy zdarzenia.
    [Show full text]