Learn your way! Get started

Advanced .NET Framework 2.0 Using C# 2005: Part 2

with expert Greg Reddick


Course at a glance

Included in these subscriptions:

  • Dev & IT Pro Video
  • Dev & IT Pro Power Pack
  • Power Pack Plus

Release date Release date 12/30/2006
Level Level Advanced
Runtime Runtime 12h 22m
Closed captioning Closed captioning N/A
Transcript Transcript N/A
eBooks / courseware eBooks / courseware Included
Hands-on labs Hands-on labs Included
Sample code Sample code Included
Exams Exams Included
Platform Platform Internet Explorer Only


Enterprise Solutions
Enterprise Solutions

Need reporting, custom learning tracks, or SCORM? Learn More



Course description

In this volume, you’ll learn about implementing service processes and application domains in your .NET applications using the System and ServiceProcess namespaces. You’ll see how to take advantage of multi-threading to create fast and efficient processes through the Threading namespace. You’ll learn how to internationalize your .NET application by using the globalization classes. Enhance your user interface with the System.Drawing and System.Text namespaces.

Meet the expert

Greg Reddick Gregory Reddick is a consultant who develops applications and websites using .NET. He is an experienced instructor with nearly 20 years of experience teaching instructor-led courses. Greg also worked as a software design engineer on Microsoft Access 1.0.


Course outline



Module 1

Multithreaded Applications (46:56)
  • Introduction (01:37)
  • Create Multithreaded Apps (01:12)
  • Thread Class (00:31)
  • Join() Method (00:22)
  • ThreadStart Delegates (00:28)
  • Demo: Thread Class (00:58)
  • Demo: Creating a Thread (01:21)
  • Demo: Synch. Threads (01:08)
  • Demo: Starting a Thread (02:24)
  • ThreadPool Class (01:06)
  • Reverse DNS Lookups (01:38)
  • Demo: ThreadPool Class (03:25)
  • Demo: Reverse DNS Lookup (06:55)
  • Timer Class (01:42)
  • Demo: Timer Class (02:29)
  • Modify UI from a Thread (00:52)
  • Calling the Invoke Method (04:21)
  • Background Worker (03:11)
  • Calling an Async. Method (00:55)
  • Demo: Asynchronous Call (04:07)
  • ThreadState Enum. (00:21)
  • ThreadPriority Enum. (00:49)
  • Demo: Thread State (02:45)
  • Demo: Thread Priority (01:48)
  • Summary (00:17)
Locking (30:27)
  • Introduction (00:41)
  • Deadlock (02:02)
  • Race Conditions (01:28)
  • Demo: Race Condition (02:42)
  • Demo: Deadlock (03:17)
  • Thread Safe Code and Locking (01:42)
  • Monitor Class (01:41)
  • Lock Statement (00:38)
  • Interlocked Class (01:31)
  • ReaderWriterLock Class (01:05)
  • Demo: Non-Thread Safe (02:32)
  • Demo: Monitor Lock (03:13)
  • Demo: Lock (01:34)
  • Demo: Interlocked Class (01:20)
  • Demo: ReaderWriterLock 1 (02:58)
  • Demo: ReaderWriterLock 2 (01:36)
  • Summary (00:19)

Module 2

Synchronization (29:18)
  • Introduction (00:32)
  • WaitHandle Class (00:29)
  • AutoResetEvent Class (00:34)
  • ManualResetEvent Class (00:27)
  • Demo: AutoResetEvent (02:54)
  • Demo: ManualResetEvent (02:08)
  • Mutex Class (01:11)
  • Semaphore Class (00:47)
  • Demo: Local Mutex (01:44)
  • Demo: Global Mutex (02:11)
  • Demo: Semaphore (05:08)
  • RegisterWaitForSingleObject (01:12)
  • Demo: RegWaitForSingleObj (03:38)
  • ExecutionContext Class (00:46)
  • Demo: ExecutionContext (03:26)
  • Demo: ExecutionContext.Run (01:43)
  • Summary (00:21)
Using StringBuilder (13:20)
  • Introduction (00:36)
  • Strings (00:33)
  • StringBuilder Class (00:41)
  • StringBuilder Characteristics (00:51)
  • Code Example Basics (03:43)
  • .NET Memory Management (01:26)
  • Demo: Garbage Collection (03:32)
  • Running the GC Demo (01:31)
  • Summary (00:23)
Regular Expressions (37:14)
  • Introduction (00:36)
  • Parsing Strings (00:24)
  • Uses of Regular Expressions (00:32)
  • Useful Resources (00:40)
  • Regex.IsMatch() Method (00:31)
  • Introduction to Patterns (00:43)
  • Demo: Regex.IsMatch() (01:35)
  • Reg. Expression Examples (16:35)
  • Reg. Expression Tester (03:40)
  • Identify Pattern Parts (01:34)
  • Match / Group Objects (00:38)
  • Using MatchCollection (00:26)
  • Parse w/Match Object (04:14)
  • Parse w/MatchCollection (01:10)
  • Understand Captures (00:18)
  • Reg. Expression Captures (03:03)
  • Summary (00:26)
Encoding (17:41)
  • Introduction (00:30)
  • Using Encoding (00:27)
  • ASCII Encoding (00:27)
  • ANSI Code Pages (01:33)
  • Unicode (00:59)
  • UTF-8 (00:57)
  • UTF-16 (00:52)
  • Other Encoding Schemes (00:27)
  • Demo: Enumerating Encodings (00:54)
  • Demo: Encoding a String (01:04)
  • Demo: File Writing/Reading (06:20)
  • Demo: Fallback (01:21)
  • Demo: Exception Fallback (01:29)
  • Summary (00:14)

Module 3

Using Culture Information (21:58)
  • Introduction (00:41)
  • Overview: Cultures (00:25)
  • Types of Cultures (00:14)
  • Invariant Culture (00:35)
  • Neutral Cultures (00:21)
  • Specific Cultures (00:21)
  • CultureInfo Class (00:48)
  • CurrentUI/Current (Culture) (00:16)
  • Getting the List of Cultures (01:20)
  • Demo: Retrieving Cultures (05:21)
  • Culture Names (00:39)
  • Language Code (00:23)
  • Country or Region Code (00:26)
  • Using a CultureInfo Object (00:28)
  • Assigning CultureInfo (00:37)
  • Parsing Dates (00:51)
  • ISO 8601 Date Format (01:09)
  • Parsing Numbers (00:59)
  • Demo: Parsing Dates (02:30)
  • Demo: Parsing Numbers (03:12)
  • Summary (00:13)
Culture Information Continued (01:07:39)
  • Introduction (00:30)
  • Dates (00:49)
  • Calendar Systems (01:06)
  • Calendars (31:15)
  • Demo: Formatting Dates (02:13)
  • Demo: Formatting Numbers (01:53)
  • Other FormatInfo Uses (01:03)
  • Demo: Culture Details (03:23)
  • RegionInfo Objects (01:30)
  • Demo: RegionInfo Objects (02:51)
  • Comparing Strings (00:52)
  • Compare() Method Options (01:44)
  • Sorting a Collection (00:17)
  • Demo: CompareInfo Object (03:59)
  • CultureAndRegionInfoBuilder (00:29)
  • Example: Pig Latin (02:02)
  • To Create a New Culture (00:31)
  • CultureAndRegionModifiers (00:31)
  • Fill the Culture (00:52)
  • Modify the Culture (00:28)
  • Save the Culture to XML (00:43)
  • Register a Culture (04:22)
  • Demo: Create a Culture (02:41)
  • Demo: Load Culture XML (00:28)
  • Demo: Remove a Culture (00:28)
  • Summary (00:28)
Creating Windows Services (27:03)
  • Introduction (00:36)
  • Overview (00:49)
  • Examples of Win Services (00:52)
  • Creating a Windows Service (01:18)
  • Windows Services Snap-in (02:11)
  • InstallUtil.exe (03:58)
  • Starting a Visual Studio Project (01:40)
  • OnStart and OnStop Methods (01:10)
  • Installing the Service (00:28)
  • Service Process Installer (02:01)
  • Service Installer (01:35)
  • Naming the Service (00:31)
  • Install the Service (01:01)
  • Starting the Service (00:16)
  • Stopping the Service (00:06)
  • Windows Event Logs (01:44)
  • Uninstalling the Service (00:25)
  • Adding Functionality (05:53)
  • Summary (00:21)

Module 4

Debugging Windows Services (25:47)
  • Introduction (00:32)
  • Creating a Test Harness (03:43)
  • Running Test Harness (01:07)
  • Debug the Running Service (03:44)
  • ServiceController Comp. (00:25)
  • Override Other Service Methods (01:13)
  • Two-way Communication (00:58)
  • Demo: ServiceController (03:55)
  • Demanding Permissions (00:25)
  • Demo: Declarative Security (01:10)
  • Demo: Imperative Security (01:51)
  • Demo: OnCustomCommand (04:16)
  • Demo: Enumerate Services (02:05)
  • Summary (00:16)
Introduction to SMTP (22:59)
  • Introduction (00:41)
  • Overview: SMTP (00:50)
  • Test SMTP Server (00:36)
  • Telnet Example (01:38)
  • Using End User"s Email App (01:00)
  • Setup Email Test (01:27)
  • Specify SMTP Server (01:10)
  • Send an Email (00:35)
  • Demo: Simple SMTP Client (02:23)
  • View Mail Queue (01:20)
  • Encoding (00:52)
  • MailAddress Class (01:28)
  • MailMessage Class (01:26)
  • DeliveryNotificationOptions (00:38)
  • Priority Property (00:18)
  • Add Recipients (00:48)
  • Demo: Using MailMessage (05:18)
  • Summary (00:23)
Advanced SMTP (31:03)
  • Introduction (00:33)
  • Adding Attachments (00:36)
  • MIME Types (01:19)
  • Syntax to Add Attachment (00:39)
  • Demo: Adding an Attachment (00:40)
  • Demo: Excel Attachment (01:24)
  • View Mail Queue (02:46)
  • Handling Exceptions (00:52)
  • Demo: HandlingExceptions (01:01)
  • Demo: Failed Recipient (02:42)
  • Sending Async. Messages (00:42)
  • Demo: Asynchronous Send (02:43)
  • Send HTML E-Mail Msgs. (01:05)
  • Demo: Send HTML Msgs. (02:41)
  • Adding Alternate Views (01:01)
  • Demo: Alternate Views (04:13)
  • Configure Credentials (02:44)
  • Demo: Config. Credentials (02:48)
  • Summary (00:23)

Module 5

Platform Invoke (28:29)
  • Introduction (00:42)
  • Using Platform Invoke (00:55)
  • PInvoke Process (00:38)
  • PInvoke and Security (00:49)
  • Windows API (01:23)
  • Identifying Functions (01:15)
  • Dumpbin Example (01:24)
  • Creating a Class (00:58)
  • Defining Prototypes (00:18)
  • Specifying the Library Name (00:31)
  • Library Search Order (01:03)
  • Specify Entry Point Name (00:50)
  • Calling by Ordinal (00:44)
  • Specifying the CharSet (01:34)
  • Using the Auto CharSet (01:15)
  • Specifying the Parameters (01:17)
  • Specifying the Return Type (00:23)
  • Demo: GetSystemMetrics (07:38)
  • WinUser.H File (04:22)
  • Summary (00:22)
Passing and Returning Data (21:44)
  • Introduction (00:29)
  • Returning Strings from PInvoke (00:25)
  • Window Handles (01:21)
  • Demo: GetWindowText (03:43)
  • Passing a Structure to PInvoke (00:30)
  • Demo: GetWindowRect (03:41)
  • Using StructLayout Attribute (02:24)
  • Example: RECTUNION (00:44)
  • Byte Aligning Structure (02:45)
  • Callback Functions (01:03)
  • Demo: Callback Function (04:21)
  • Summary (00:13)
Marshalling Data (26:20)
  • Introduction (00:37)
  • Error Handling (Unmanaged) (00:45)
  • Why No GetLastError? (00:43)
  • Using SetLastError Property (00:45)
  • Demo: SetLastError Property (05:26)
  • Marshalling (00:56)
  • Blittable Types (01:00)
  • Using the MarshalAs Attribute (01:16)
  • In and Out Attributes (00:42)
  • More About Attributes (00:53)
  • Examples: PInvoke Calls (01:16)
  • Demo: Byte Size (04:47)
  • Demo: System Menus (06:52)
  • Summary (00:16)

Module 6

Calling COM from .NET (23:45)
  • Introduction (00:34)
  • COM Interop (00:31)
  • COM Components (01:10)
  • Useful Reference Book (00:27)
  • Creating a Runtime Wrapper (00:46)
  • COM Type Libraries (00:24)
  • Create RCW w/VS.NET (00:52)
  • Create RCW w/Tlbimp (00:56)
  • Demo: Create RCW w/VS.NET (01:36)
  • Demo: Create RCW w/Tlbimp (01:02)
  • Fine Tuning the RCW (00:26)
  • Using a COM Library (02:04)
  • Demo: Using a DLL in .NET (01:28)
  • Marshal.ReleaseComObject (00:37)
  • Driving Excel from .NET (01:57)
  • Demo: Driving Excel (07:56)
  • Keeping Excel Invisible (00:29)
  • Summary (00:23)
Calling .NET Assemblies (20:48)
  • Introduction (00:28)
  • Call Managed Code from COM (01:30)
  • COM Friendly Classes (01:11)
  • Create Type Library (00:44)
  • Demo: Credit Card Check (03:55)
  • Code: Credit Card Check (04:33)
  • A .NET Library in VB 6 (03:05)
  • TypeLibConverter Class (00:29)
  • Demo: Assembly to TypeLib (03:00)
  • Demo: TypeLib to Assembly (01:30)
  • Summary (00:19)
Introduction to Reflection (12:53)
  • Introduction (00:31)
  • Overview (00:21)
  • Assembly Class (01:14)
  • Demo: Using Assembly Class (03:19)
  • Assembly Attributes (02:35)
  • Pseudo-Attributes (00:41)
  • Non-Pseudo Attributes (00:27)
  • Retrieving Assembly Attributes (00:22)
  • Demo: Assembly Attributes (02:57)
  • Summary (00:20)

Module 7

Advanced Reflection (30:11)
  • Introduction (00:34)
  • Creating a Custom Attribute (00:52)
  • Demo: Attribute Creation (01:46)
  • Information About Types (00:50)
  • Info Classes (00:40)
  • MemberInfo Class (00:50)
  • Getting Method Information (00:41)
  • Demo: Info Classes (02:18)
  • View Code: Info Classes (04:35)
  • SampleMethod Code (02:20)
  • Late Binding (00:39)
  • Calling a Static Method (00:29)
  • Calling an Instance Method (00:50)
  • Demo: Late Binding (00:53)
  • View Code: Static Method (00:12)
  • Calling a Shared Method (01:49)
  • View Code: Instance Method (02:25)
  • Creating Code at Runtime (01:23)
  • Builder Classes (00:31)
  • Demo: Code at Runtime (04:31)
  • Testing the Code (00:36)
  • Summary (00:18)
Graphics Fundamentals (45:57)
  • Introduction (00:47)
  • Drawing Graphics (00:26)
  • Point and PointF Structures (00:37)
  • Size and SizeF Structures (00:26)
  • Rectangle and RectangleF (00:43)
  • Color Structure (01:16)
  • OnPaint() Method (01:10)
  • OnPaintBackground() Method (00:37)
  • Graphics Class (01:09)
  • Demo: Paint Events (02:28)
  • Color Structure Properties (18:27)
  • Pen Class (00:33)
  • Pens Class (00:20)
  • SystemPens Class (00:24)
  • Brush Class (01:04)
  • Brushes Class (00:18)
  • SystemBrushes Class (00:26)
  • SolidBrush Class (00:40)
  • TextureBrush Class (00:19)
  • HatchBrush Class (00:15)
  • LinearGradient Brush (00:14)
  • PathGradient Brush Class (00:25)
  • Demo: Pens, Brushes, Colors (02:55)
  • Demo: Using Pens (02:33)
  • Demo: Using Brushes (06:59)
  • Summary (00:15)
Images and Fonts (01:45:20)
  • Introduction (00:26)
  • Image, Bitmap, Metafile Class (01:03)
  • Demo: Images (02:03)
  • Font Class (40:10)
  • FontFamily Class (00:37)
  • SystemFonts Class (01:04)
  • Demo: Fonts (03:14)
  • StringFormat Class (00:28)
  • Demo: StringFormat Class (02:58)
  • Alignment Property (01:06)
  • LineAlignment Property (00:41)
  • StringFormatFlags (27:38)
  • ImageAnimator Class (00:25)
  • Demo: ImageAnimator Class (02:20)
  • BufferedGraphics Class (00:44)
  • Demo: BufferedGraphics Class (05:58)
  • Icon Class (00:14)
  • SystemIcons Class (00:21)
  • Converter Classes (01:01)
  • ColorTranslator Class (00:49)
  • Demo: Icons (01:01)
  • Demo: Converter Classes (06:19)
  • Demo: ColorTranslator (01:45)
  • Region Class (00:19)
  • Demo: Regions (02:12)
  • Summary (00:11)

Module 8

Graphics Demonstrations (12:01)
  • Introduction (00:26)
  • Demo: Chess Board (00:47)
  • Code Behind the Chess Board (01:54)
  • Demo: Brand Image (01:00)
  • Code Behind the Brand (01:53)
  • Demo: Simple Chart (00:38)
  • Code Behind the Chart (02:13)
  • Demo: Thumbnail (00:16)
  • Code Behind the Thumbnail (02:17)
  • Review (00:11)
  • Summary (00:20)
Application Domains (21:22)
  • Introduction (00:33)
  • Overview (03:06)
  • Creating an App. Domain (00:16)
  • Unloading a Domain (00:22)
  • Configuring a Domain (00:24)
  • Retrieving Setup Information (00:09)
  • Loading Assemblies (01:44)
  • Demo: Student Projects (05:56)
  • Demo: Domain Security (05:17)
  • Demo: Evidence (01:40)
  • Demo: Evidence on Domain (01:35)
  • Summary (00:16)
Recursion (21:43)
  • Introduction (00:31)
  • Recursion Defined (00:48)
  • Examples of Recursion (00:34)
  • Eight Queens Problem (00:51)
  • Code for Eight Queens (04:42)
  • Knight"s Tour Problem (01:40)
  • Code for Knight"s Tour (05:50)
  • Towers of Hanoi Problem (01:06)
  • Code for Towers of Hanoi (05:18)
  • Summary (00:19)