ebook img

.NET Development for Java Programmers PDF

399 Pages·2002·10.888 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview .NET Development for Java Programmers

.NET Development for Java Programmers PAUL GIBBONS APress Media, LLC .NET Development for Java Programmers Copyright ©2002 by Paul Gibbons Originally published by Apress in 2002 All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. ISBN 978-1-59059-038-6 ISBN 978-1-4302-1106-8 (eBook) DOI 10.1007/978-1-4302-1106-8 Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. Technical Reviewer: David Pollak Editorial Directors: Dan Appleman, Peter Blackburn, Gary Cornell, Jason Gilmore, Simon Hayes, Karen Watterson, John Zukowski Managing Editor: Grace Wong Project Manager: Alexa Stuart Copy Editor: Kim Wimpsett Production Editor: Janet Vail Composition: Impressions Book and Journal Services, Inc. Indexer: Shane-Armstrong Information Services Cover Designer: Kurt Krames Manufacturing Manager: Tom Debolski Marketing Manager: Stephanie Rodriguez The information in this book is distributed on an "as is" basis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work. To my family, for all the things you continue to teach me. Contents at a Glance Foreword .............................................................x iii About the Author ....................................................x v About the Technical Reviewer .....................................x vi Acknowledgments ....................................................x vii Introduction ........................................................x ix Chapter 1 Introducing C# ............................................ 1 Chapter 2 Introducing the C# Language ............................9 Chapter 3 Introducing the • NET Platform .........................5 9 Chapter 4 Using Win forms ...........................................6 7 Chapter 5 Building Web Sites with ASP.NET ......................9 7 Chapter 6 Exploring ADO. NET .......................................1 17 Chapter 7 Understanding Multithreading .........................1 57 Chapter 8 Understanding Networking .............................. 171 Chapter 9 Working with XML ........................................2 05 Chapter 10 Creating Components ..................................2 25 Chapter 11 Packaging and Installing Applications .............2 67 Chapter 12 Communicating via Message Queuing ..................2 97 Chapter 13 Using Active Directory Service Interface ..........3 17 Chapter 14 Developing Windows Services .........................3 25 Chapter 15 Getting Outside the Box ..............................3 43 Chapter 16 Migrating to • NET .....................................3 63 Index .................................................................3 69 v Contents Foreword .............................................................x zzz About the Author ....................................................x v About the Technical Reviewer .....................................x vi Acknowledgments ....................................................x vii Introduction ........................................................x ix Chapter 1 Introducing C# .....................................I Creating HelloWorld in C# Using the SDK Tools ...................1 Creating HelloWorld in C# Using Visual Studio .NET ..............3 Summary ................................................................B Chapter 2 Introducing the C# Language .................. 9 The History of Java and C# .........................................9 Understanding Simple Types ........................................1 0 Introducing Variable Scope .........................................1 3 Exploring Arrays .....................................................1 3 Understanding Statements and Expressions ........................1 5 Introducing Functions and Methods ................................2 5 Understanding Types and Objects ..................................2 8 Introducing Enumerations .......................................... .49 Understanding Exceptions ...........................................5 0 Using Namespaces and the using Directive ........................5 1 Using Documentation Comments ......................................5 3 Using the Preprocessor ..............................................5 5 Writing Unsafe Code .................................................5 7 Standardizing C# ....................................................5 7 Summary ...............................................................5 8 Chapter 3 Introducing the . NET Platform .............. 59 The Pieces of the • NET Platform ..................................5 9 The Benefits of • NET ............................................... 62 Summary ...............................................................6 6 vii Contents Chapter 4 Using Win Forms .................................... 67 Creating HelloWorld in Win Forms ..................................6 7 Using WinForms Controls ............................................ 72 Looking Deeper at Layout ........................................... 75 Creating Menus ...................................................... 76 Creating Toolbars ....................................................8 1 Adding Help ..........................................................8 6 Printing .............................................................8 6 Exploring Multithreading Issues ..................................8 8 Using the Noti fyicon Control ......................................8 9 Incorporating ActiveX Controls ....................................9 1 Summary ...............................................................9 5 Chapter 5 Building Web Sites with ASP. NET ........... 97 Creating a Simple Web Forms Page ..................................9 7 Using the WebControls .............................................1 01 Building Your OWn Controls .......................................1 05 Creating ASP. NET Applications ....................................1 09 Maintaining State ..................................................1 10 Using HttpHandler Pages ...........................................1 12 Comparing ASP. NET to ASP .........................................1 15 Summary ..............................................................1 15 Chapter 6 Exploring ADO.NET .............................. 117 Using Visual Studio .NET Database Features ....................1 17 Comparing a Simple Query in JDBC and ADO.NET ..................1 24 Using Command Parameters ..........................................1 30 Using Stored Procedures ...........................................1 31 Using DataSets .....................................................1 33 Understanding Pooling .............................................1 46 Implementing Data-Bound Controls ................................1 46 Comparing ADO.NET to the Current ADO ...........................1 55 Summary ..............................................................1 56 viii Contents Chapter 1 Understanding Multi threading .............. 157 Starting Threads ....................................................1 57 Manipulating Threads ..............................................1 60 Understanding Thread Pooling .....................................1 62 Using SynchronizationAttribute ..................................1 64 Using Monitors .....................................................1 65 Using Mutexes .......................................................1 67 Applying Interlocked Access ......................................1 68 What Is an Apartment? .............................................1 69 Understanding Threads and Garbage Collection ..................1 69 Summary ..............................................................1 70 Chapter 8 Understanding Networking .................... 171 Starting with Sockets .............................................1 71 Using Pluggable Protocols ........................................1 74 Understanding Remoting ............................................1 75 Using ASP. NET Web Services .......................................1 81 Summary ..............................................................2 03 Chapter 9 Working with XML ................................ 205 Introducing the System.XML Classes ..............................2 05 Using XML DOM .......................................................2 06 Implementing XmlReader and XmlWriter Instead of SAX ...........................................................2 09 Understanding XML Schema Validation ............................2 09 Implementing XSL T Transforms .....................................2 11 Using XPath Expressions ...........................................2 15 Using XML Serialization ...........................................2 17 Working with the XML Schema Definition Tool ...................2 20 Using Visual Studio • NET and XML ................................2 22 Summary ..............................................................2 23 ix Contents Chapter 10 Creating Components .......................... 225 Introducing • NET Components ......................................2 25 Understanding COM ..................................................2 46 Understanding COM+ .................................................2 52 Looking to ObjectSpaces ...........................................2 65 Summary ..............................................................2 65 Chapter 11 Packaging and Installing Applications ....................................2 67 Another Look at Assemblies ........................................2 67 Using xcopy Deployment ............................................2 68 Using CAB Files ....................................................2 68 Using Windows Installer ...........................................2 68 Launching from Internet Explorer ................................2 76 Installing into the Global Assembly Cache .....................2 80 Setting Dynamic Properties .......................................2 83 Integrating Installation Components ............................2 88 Summary ..............................................................2 95 Chapter 12 Communicating via Message Queuing ......2 97 Configuring Message Queuing .......................................2 97 Creating a Message-Queuing API ..................................3 01 Comparing Message Queuing to JMS ................................3 14 Using the Message Queuing Installation Component .............3 14 Summary ..............................................................3 15 Chapter 13 Using Active Directory Service Interface .............................................3 17 Reading Directory Entries ........................................3 17 Adding and Modifying Directory Entries .........................3 19 Using Providers ....................................................3 22 Comparing ADS! to JNDI ............................................3 23 Summary ..............................................................3 23 X Contents Chapter 14 Developing Windows Services .............. 325 Creating a Windows Service .......................................3 25 Debugging ............................................................3 30 Using SCM Command Handlers .......................................3 33 Writing to Event Logs .............................................3 34 Using Performance Counters .......................................3 36 Creating Setup Projects for Windows Services ..................3 40 Summary ..............................................................3 41 Chapter 15 Getting Outside the Box .................... 343 Using Platform Invoke .............................................3 43 Writing Unsafe Code ................................................3 50 Hosting the • NET Runtime .........................................3 57 Summary ..............................................................3 62 Chapter 16 Migrating to • NET .............................3 63 JUMPing to • NET ....................................................3 63 Exploring Migration Strategies for the Rest of Us .............3 66 Summary ..............................................................3 68 Index ................................................................ 369 xi

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.