did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

We're the #1 textbook rental company. Let us show you why.

9781590595893

Visual C# 2005 Recipes: A Problem-Solution Approach

by
  • ISBN13:

    9781590595893

  • ISBN10:

    1590595890

  • Format: Paperback
  • Copyright: 2006-01-16
  • Publisher: Textstream
  • Purchase Benefits
  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $49.99 Save up to $33.11
  • Buy New
    $48.49
    Add to Cart Free Shipping Icon Free Shipping

    USUALLY SHIPS IN 2-3 BUSINESS DAYS

Supplemental Materials

What is included with this book?

Summary

The recipes included in this book have been chosen and written with emerging pros in mind. The book features an equal balance of code and text. The supplied code gives you everything you need to solve the problem at hand, while the accompanying text provides supporting information. This is a fully up-to-date reference for .NET 2.0 programmers. All code comes as a stand-alone Visual Studio 2005 solution. The book even covers advanced concepts that take you past basic recipe solutions you'll be able to distil entire concepts and theories.

Table of Contents

About the Authors xv
About the Technical Reviewer xvii
Acknowledgments xix
Preface xxi
Application Development
1(30)
Create a Console Application from the Command Line
2(2)
Create a Windows-Based Application from the Command Line
4(3)
Create and Use a Code Module
7(2)
Create and Use a Code Library from the Command Line
9(1)
Access Command-Line Arguments
10(2)
Include Code Selectively at Build Time
12(3)
Access a Program Element That Has the Same Name As a Keyword
15(1)
Create and Manage Strong-Named Key Pairs
16(1)
Give an Assembly a Strong Name
17(2)
Verify That a Strong-Named Assembly Has Not Been Modified
19(1)
Delay Sign an Assembly
20(2)
Sign an Assembly with an Authenticode Digital Signature
22(3)
Create and Trust a Test Software Publisher Certificate
25(2)
Manage the Global Assembly Cache
27(1)
Prevent People from Decompiling Your Code
27(1)
Manipulate the Appearance of the Console
28(3)
Data Manipulation
31(34)
Manipulate the Contents of a String Efficiently
31(2)
Encode a String Using Alternate Character Encoding
33(3)
Convert Basic Value Types to Byte Arrays
36(2)
Base64 Encode Binary Data
38(3)
Validate Input Using Regular Expressions
41(4)
Use Compiled Regular Expressions
45(2)
Create Dates and Times from Strings
47(2)
Add, Subtract, and Compare Dates and Times
49(2)
Sort an Array or an ArrayList
51(1)
Copy a Collection to an Array
52(2)
Use a Strongly Typed Collection
54(1)
Create a Generic Type
55(3)
Store a Serializable Object to a File
58(3)
Read User Input from the Console
61(4)
Application Domains, Reflection, and Metadata
65(30)
Create an Application Domain
66(1)
Create Types That Can Be Passed Across Application Domain Boundaries
67(3)
Avoid Loading Unnecessary Assemblies into Application Domains
70(1)
Create a Type That Cannot Cross Application Domain Boundaries
71(1)
Load an Assembly into the Current Application Domain
72(2)
Execute an Assembly in a Different Application Domain
74(2)
Instantiate a Type in a Different Application Domain
76(4)
Pass Data Between Application Domains
80(2)
Unload Assemblies and Application Domains
82(1)
Retrieve Type Information
83(2)
Test an Object's Type
85(2)
Instantiate an Object Using Reflection
87(4)
Create a Custom Attribute
91(2)
Inspect the Attributes of a Program Element Using Reflection
93(2)
Threads, Processes, and Synchronization
95(48)
Execute a Method Using the Thread Pool
96(3)
Execute a Method Asynchronously
99(8)
Execute a Method Periodically
107(2)
Execute a Method at a Specific Time
109(2)
Execute a Method by Signaling a WaitHandle Object
111(2)
Execute a Method Using a New Thread
113(2)
Synchronize the Execution of Multiple Threads Using a Monitor
115(5)
Synchronize the Execution of Multiple Threads Using an Event
120(4)
Synchronize the Execution of Multiple Threads Using a Mutex
124(2)
Synchronize the Execution of Multiple Threads Using a Semaphore
126(2)
Synchronize Access to a Shared Data Value
128(2)
Know When a Thread Finishes
130(2)
Terminate the Execution of a Thread
132(2)
Create a Thread-Safe Collection Instance
134(1)
Start a New Process
135(3)
Terminate a Process
138(2)
Ensure That Only One Instance of an Application Can Execute Concurrently
140(3)
Files, Directories, and I/O
143(40)
Retrieve Information About a File, Directory, or Drive
143(4)
Set File and Directory Attributes
147(2)
Copy, Move, or Delete a File or a Directory
149(2)
Calculate the Size of a Directory
151(1)
Retrieve Version Information for a File
152(2)
Show a Just-in-Time Directory Tree in the TreeView Control
154(2)
Read and Write a Text File
156(2)
Read and Write a Binary File
158(2)
Read a File Asynchronously
160(3)
Find Files That Match a Wildcard Expression
163(1)
Test Two Files for Equality
164(1)
Manipulate Strings Representing Filenames
165(2)
Determine If a Path Is a Directory or a File
167(1)
Work with Relative Paths
168(1)
Create a Temporary File
169(1)
Get the Total Free Space on a Drive
170(2)
Show the Common File Dialog Boxes
172(2)
Use an Isolated Store
174(2)
Monitor the File System for Changes
176(3)
Access a COM Port
179(1)
Get a Random Filename
180(1)
Manipulate the Access Control Lists of a File or Directory
180(3)
XML Processing
183(30)
Show the Structure of an XML Document in a TreeView
183(4)
Insert Nodes in an XML Document
187(2)
Quickly Append Nodes in an XML Document
189(2)
Find Specific Elements by Name
191(1)
Get XML Nodes in a Specific XML Namespace
192(2)
Find Elements with an XPath Search
194(3)
Read and Write XML Without Loading an Entire Document into Memory
197(2)
Validate an XML Document Against a Schema
199(5)
Use XML Serialization with Custom Objects
204(3)
Create a Schema for a .NET Class
207(1)
Generate a Class from a Schema
208(1)
Perform an XSL Transform
209(4)
Windows Forms
213(44)
Add a Control Programmatically
214(2)
Link Data to a Control
216(2)
Process All the Controls on a Form
218(2)
Track the Visible Forms in an Application
220(3)
Find All MDI Child Forms
223(2)
Save Configuration Settings for a Form
225(3)
Force a List Box to Scroll to the Most Recently Added Item
228(1)
Restrict a Textbox to Accepting Only Specific Input
229(3)
Use an Autocomplete Combo Box
232(3)
Sort a List View by Any Column
235(3)
Lay Out Controls Automatically
238(1)
Use Part of a Main Menu for a Context Menu
239(2)
Make a Multilingual Form
241(3)
Create a Form That Cannot Be Moved
244(1)
Make a Borderless Form Movable
244(3)
Create an Animated System Tray Icon
247(1)
Validate an Input Control
248(3)
Use a Drag-and-Drop Operation
251(1)
Use Context-Sensitive Help
252(2)
Display a Web Page in a Windows-Based Application
254(3)
Graphics, Multimedia, and Printing
257(42)
Find All Installed Fonts
257(2)
Perform Hit Testing with Shapes
259(4)
Create an Irregularly Shaped Control
263(2)
Create a Movable Sprite
265(3)
Create a Scrollable Image
268(2)
Perform a Screen Capture
270(1)
Use Double Buffering to Increase Redraw Speed
271(2)
Show a Thumbnail for an Image
273(2)
Play a Simple Beep or System Sound
275(1)
Play a WAV File
276(1)
Play a Sound File
277(2)
Show an Animation with DirectShow
279(3)
Retrieve Information About the Installed Printers
282(2)
Print a Simple Document
284(3)
Print a Multipage Document
287(3)
Print Wrapped Text
290(2)
Show a Dynamic Print Preview
292(3)
Manage Print Jobs
295(4)
Database Access
299(36)
Connect to a Database
301(3)
Use Connection Pooling
304(2)
Create a Database Connection String Programmatically
306(2)
Store a Database Connection String Securely
308(3)
Execute a SQL Command or Stored Procedure
311(4)
Use Parameters in a SQL Command or Stored Procedure
315(3)
Process the Results of a SQL Query Using a Data Reader
318(3)
Obtain an XML Document from a SQL Server Query
321(3)
Perform Asynchronous Database Operations Against SQL Server
324(3)
Write Database-Independent Code
327(4)
Discover All Instances of SQL Server on Your Network
331(4)
Networking and Remoting
335(58)
Obtain Information About the Local Network Interface
336(3)
Detect Changes in Network Connectivity
339(2)
Download Data over HTTP or FTP
341(2)
Download a File and Process It Using a Stream
343(3)
Respond to HTTP Requests from Your Application
346(3)
Get an HTML Page from a Site That Requires Authentication
349(2)
Send E-mail Using SMTP
351(4)
Resolve a Host Name to an IP Address
355(2)
Ping an IP Address
357(2)
Communicate Using TCP
359(4)
Create a Multithreaded TCP Server That Supports Asynchronous Communications
363(8)
Communicate Using UDP
371(3)
Avoid Hard-Coding the XML Web Service URL
374(2)
Set Authentication Credentials for an XML Web Service
376(2)
Call a Web Method Asynchronously
378(3)
Make an Object Remotable
381(4)
Register All the Remotable Classes in an Assembly
385(2)
Host a Remote Object in IIS
387(1)
Control the Lifetime of a Remote Object
388(2)
Control Versioning for Remote Objects
390(3)
Security and Cryptography
393(46)
Allow Partially Trusted Code to Use Your Strong-Named Assembly
394(2)
Disable Code Access Security
396(2)
Disable Execution Permission Checks
398(2)
Ensure the Runtime Grants Specific Permissions to Your Assembly
400(2)
Limit the Permissions Granted to Your Assembly
402(1)
View the Permissions Required by an Assembly
403(3)
Determine at Runtime If Your Code Has a Specific Permission
406(1)
Restrict Who Can Extend Your Classes and Override Class Members
407(2)
Inspect an Assembly's Evidence
409(2)
Determine If the Current User Is a Member of a Specific Windows Group
411(3)
Restrict Which Users Can Execute Your Code
414(4)
Impersonate a Windows User
418(3)
Create a Cryptographically Random Number
421(1)
Calculate the Hash Code of a Password
422(3)
Calculate the Hash Code of a File
425(2)
Verify a Hash Code
427(2)
Ensure Data Integrity Using a Keyed Hash Code
429(3)
Work with Security-Sensitive Strings in Memory
432(3)
Encrypt and Decrypt Data Using the Data Protection API
435(4)
Unmanaged Code Interoperability
439(18)
Call a Function in an Unmanaged DLL
439(3)
Get the Handle for a Control, Window, or File
442(2)
Call an Unmanaged Function That Uses a Structure
444(3)
Call an Unmanaged Function That Uses a Callback
447(1)
Retrieve Unmanaged Error Information
448(2)
Use a COM Component in a .NET Client
450(2)
Release a COM Component Quickly
452(1)
Use Optional Parameters
453(1)
Use an ActiveX Control in a .NET Client
454(1)
Expose a .NET Component Through COM
455(2)
Commonly Used Interfaces and Patterns
457(42)
Implement a Serializable Type
457(6)
Implement a Cloneable Type
463(4)
Implement a Comparable Type
467(4)
Implement an Enumerable Collection
471(4)
Implement an Enumerable Type Using a Custom Iterator
475(5)
Implement a Disposable Class
480(3)
Implement a Formattable Type
483(3)
Implement a Custom Exception Class
486(4)
Implement a Custom Event Argument
490(2)
Implement the Singleton Pattern
492(1)
Implement the Observer Pattern
493(6)
Windows Integration
499(22)
Access Runtime Environment Information
499(4)
Retrieve the Value of an Environment Variable
503(1)
Write an Event to the Windows Event Log
504(1)
Read and Write to the Windows Registry
505(3)
Search the Windows Registry
508(3)
Create a Windows Service
511(5)
Create a Windows Service Installer
516(2)
Create a Shortcut on the Desktop or Start Menu
518(3)
Appendix Acronyms 521(6)
Index 527

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Rewards Program