+612 9045 4394
Visual Basic.NET Tips and Techniques : Tips & Techniques - Kris Jamsa

Visual Basic.NET Tips and Techniques

Tips & Techniques

Paperback Published: 29th May 2002
ISBN: 9780072223187
Number Of Pages: 708

Share This Book:


RRP $122.00
or 4 easy payments of $22.56 with Learn more
Ships in 7 to 10 business days

Bestselling and highly acclaimed Visual Basic author Kris Jamsa delivers the ultimate VB.NET resource. Organized by topic and packed with critical information, this book effectively explains complex concepts with precision. Filled with proven techniques and hundreds of solutions that can be put to immediate use easily and effectively, this is a must-have guide for every Visual Basic developer and programmer working with Web services and applications on the .NET platform.

Acknowledgmentsp. xvii
Introductionp. xix
Laying Your Visual Basic .NET Foundationp. 1
Creating Your First Console Applicationp. 2
Building a Windows-Based Applicationp. 4
Choosing the Correct Visual Basic Typesp. 6
Declaring Variables in a Visual Basic .NET Programp. 7
Displaying Screen Output Using Console.Write and Console.WriteLinep. 9
Formatting Program Output Using Console.WriteLinep. 11
Concatenating Characters to the End of a Stringp. 13
Forcing Programs to Specify a Variable's Typep. 15
Beware of Variable Overflow and Precisionp. 17
Performing Numeric Operationsp. 19
Casting a Value of One Variable Type to Anotherp. 22
Making Decisions Using Conditional Operatorsp. 24
Taking a Closer Look at the Visual Basic .NET Relational and Logical Operatorsp. 27
Handling Multiple Conditions Using Selectp. 29
Repeating a Series of Instructionsp. 31
Avoiding Infinite Loopsp. 34
Executing a Loop Prematurelyp. 34
Visual Basic .NET Supports Lazy Evaluation to Improve Performancep. 35
Wrapping Long Statementsp. 36
Taking Advantage of the Visual Basic Assignment Operatorsp. 37
Commenting Your Program Codep. 38
Reading Keyboard Input Using Console.Read and Console.ReadLinep. 39
Displaying a Message in a Message Boxp. 40
Prompting the User for Input Using an Input Boxp. 41
Breaking a Programming Task into Manageable Piecesp. 43
Passing Parameters to a Function or Subroutinep. 47
Declaring Local Variables in a Function or Subroutinep. 49
Changing a Parameter's Value in a Subroutinep. 51
Using Scope to Understand the Locations in a Program Where a Variable Has Meaningp. 52
Storing Multiple Values of the Same Type in a Single Variablep. 55
Grouping Values in a Structurep. 58
Improving Your Code's Readability Using Constantsp. 60
Summarizing the Differences Between Visual Basic and Visual Basic .NETp. 62
Exploiting the .NET Environmentp. 64
Taking Advantage of the Common Language Runtimep. 65
Declaring Variables Based on Common Typesp. 67
Migrating to ASP.NETp. 70
Exploiting Windows Formsp. 74
Making Sense of Metadatap. 76
Organizing Object Libraries Using Namespacesp. 79
Taking Advantage of Intermediate Language Codep. 82
Packaging .NET Solutions into Assembliesp. 84
Leveraging Managed Memory and Garbage Collectionp. 86
Making Sense of .NET Versioningp. 89
Standardizing Error Handlingp. 90
Programming Visual Basic .NET Classesp. 92
Using Scope Attributes to Restrict Access to Class Membersp. 97
Initializing Class Member Variablesp. 100
Defining Multiple Constructors to Support Different Parametersp. 102
Simplifying Object Member Referencesp. 105
Taking Advantage of Static Class Membersp. 107
Taking Advantage of Properties to Control Values a Class Member Can Storep. 109
Avoiding Parameter Name and Class Member Variable Name Conflictsp. 112
Performing "Cleanup" Processing Using a Destructor Methodp. 112
Mapping a Class Object to a Visual Basic .NET Formp. 114
Taking a Closer Look at .NET Garbage Collectionp. 115
Forcing the Garbage Collector to Collect Unused Memoryp. 117
Providing Destructor-like Support for Dispose Operationsp. 119
Taking a Closer Look at Visual Basic .NET Formsp. 120
Taking a Closer Look at a Class Using the Visual Studio Class Viewp. 123
Sharing a Class Member Variable Among Class Instancesp. 124
Inserting a Class Template Using Visual Studiop. 125
Researching Classes Using the Visual Studio Object Browserp. 127
Object-Oriented Programming in Visual Basic .NETp. 128
Keeping Track of Constructor Methodsp. 129
Passing Parameters to the Base-Class Constructorp. 131
Taking a Close Look at Inheritance and Destructor Methodsp. 134
Method Overloading and Inheritancep. 137
Method Overriding and Inheritancep. 140
Shadowing a Base-Class Methodp. 144
Forcing a Specific Method's Invocation Using MyClassp. 146
Preventing Class Inheritancep. 148
Implementing Polymorphic Objects that Change Form as Your Program Executesp. 149
Taking a Sneak Preview at Inheritance and Eventsp. 151
Restricting a Class for Use Only as a Base Classp. 152
Forcing a Derived Class to Override a Base-Class Methodp. 152
Multiple Levels of Inheritance Differs from Multiple Inheritancep. 156
Creating an Interfacep. 158
Implementing Multiple Interfaces Within a Classp. 162
Inheriting a Class that Implements an Interfacep. 163
Test Driving the Common Language Runtime and Base Class Libraryp. 166
Retrieving the Current System Date and Timep. 167
Taking a Closer Look at the DateTime Classp. 169
Taking a Closer Look at the String Classp. 172
Improving Performance Using a StringBuilder Objectp. 176
Exploiting the Math Classp. 179
Sending E-mail Messages from Within a Visual Basic .NET Programp. 181
Programming Visual Basic .NET File and Directory Operationsp. 184
Getting Started with the Directory Classp. 185
Retrieving and Manipulating Directory Attributesp. 190
Creating a Unique Directoryp. 193
Retrieving a Directory's Files and Subdirectoriesp. 194
Determining a System's Logical Disk Drivesp. 196
Retrieving a Directory's Files and Subdirectories Using the DirectoryInfo Classp. 197
Retrieving a Directory's Parent or Root Directoryp. 198
Manipulating a Directory Pathp. 200
Performing Common File Operationsp. 204
Taking Advantage of File Attributesp. 207
Starting with File Streamsp. 213
Taking a Closer Look at the StreamWriter and StreamReader Classesp. 217
Reading and Writing Binary Datap. 221
Getting Started with File Locksp. 225
Responding to FileWatcher Eventsp. 227
Leveraging the .NET Common Dialogsp. 230
Prompting the User for a File to Openp. 232
Fine-Tuning OpenFileDialog Operationsp. 235
Saving Information in a User-Specified Filep. 239
Fine-Tuning File Save Operationsp. 241
Selecting Font Attributesp. 244
Putting a User's Font Selections to Usep. 247
Selecting a Colorp. 248
Fine-Tuning Color Dialog Box Operationsp. 250
Using the PrintDialog Class to Prompt the User for Printing Optionsp. 252
Determining Available Printersp. 255
Using the PageSetupDialog Class to Prompt the User for Page Settingsp. 256
Performing Print Operationsp. 260
Exploiting Multiple Threads of Executionp. 264
Creating and Running Multiple Threadsp. 267
Putting a Thread to Sleepp. 270
Suspending, Resuming, and Aborting a Threadp. 272
Taking a Closer Look at the Thread Classp. 275
Assigning Thread Namesp. 277
Suspending One Thread's Execution Until a Specific Thread Completes Its Processingp. 280
Controlling Thread Prioritiesp. 283
Taking Advantage of the Thread Poolp. 286
Recognizing Potential Race Conditions Between Threadsp. 288
Using SyncLock to Protect a Shared Resourcep. 292
Synchronizing Thread Resource Access Using the Monitor Classp. 294
Preventing Thread Blocking with Monitor.TryEnterp. 298
Protecting Shared Variable Increment and Decrement Operations Using InterLockedp. 300
Taking a Closer Look at the Process Classp. 301
Launching a Program Using the Process Classp. 306
Terminating a Processp. 310
Preventing Two Copies of the Same Program from Executing at the Same Timep. 312
Displaying Information About Each Process in Your Systemp. 313
Displaying Information About a Process's Threadsp. 314
Taking Advantage of Structured Error Handlingp. 318
Catching a Specific Exceptionp. 324
Testing for Different Exceptionsp. 327
Handling Exceptions Using a Generic Catch Statementp. 328
Performing "Cleanup" Processing After an Exception Occursp. 330
Taking a Closer Look at the System.Exception Classp. 333
Creating Your Own Custom Exceptionsp. 335
Testing Your Exception Handling by Throwing an Exceptionp. 336
Chasing Down the Code Location that Caused an Exceptionp. 339
Taking a Closer Look at the Debug Classp. 341
Determining If the Debugger Is Activep. 346
Using Debug Class Assertions to Locate Program Errorsp. 347
Using Event Logs to Track Program Operationsp. 348
Responding to and Handling Eventsp. 354
Defining and Raising an Event in a Classp. 355
Handling an Event Using the Handles Clausep. 358
Specifying an Event Handler Using AddHandlerp. 361
Calling Multiple Handlers for an Eventp. 363
Adding and Removing Event Handlersp. 365
Taking Advantage of Events and Class Inheritancep. 366
Using a .NET Delegate to Point to a Functionp. 367
Taking Advantage of a Delegate in a Subroutine Callp. 370
Sorting Data Using Delegatesp. 373
Assigning Multiple Methods to a Delegatep. 377
Viewing a Delegate's Invocation Listp. 378
Responding to Timer Eventsp. 379
Taking a Closer Look at the EventArgs Classp. 381
Programming Windows Formsp. 384
Programming the Form Controlp. 388
Programming the Button Controlp. 390
Programming the Label Controlp. 392
Adding Images to a Form's Labelp. 395
Programming the LinkLabel Classp. 396
Programming Menu Controlsp. 398
Programming the PictureBox Controlp. 399
Programming the NumericUpDown Controlp. 402
Programming the ComboBox Controlp. 404
Displaying an Operation's Status Using a ProgressBar and the StatusBarp. 405
Programming the TextBox Controlp. 407
Programming the RichTextBox Controlp. 409
Programming ScrollBar Controlsp. 411
Programming the TrackBar Controlp. 412
Programming the ToolBar Controlp. 414
Programming the RadioButton Controlp. 416
Using a GroupBox to Group Radio Buttonsp. 417
Programming the CheckBox Controlp. 419
Programming the DomainUpDown Controlp. 421
Programming the ListBox Controlp. 422
Programming the CheckedListBox Controlp. 424
Programming the DateTimePicker Controlp. 425
Programming the MonthCalendar Controlp. 427
Programming a Tab Controlp. 428
Using a Panel Control to Group Controlsp. 430
Programming the TreeView Controlp. 431
Programming the ListView Controlp. 433
Looking Closer at .NET Assemblies and Versioningp. 436
Revisiting .NET Assembliesp. 437
Creating a Class Libraryp. 439
Leveraging a Class Library's Programming-Language Independencep. 441
Taking a Closer Look at a Shared Assembly's Public Keyp. 443
Installing a Shared Assembly into the Global Assembly Cachep. 444
Exploiting .NET Versioningp. 444
Precompiling a Shared Assembly to Reduce Load Timep. 446
Using the @Assembly Directive in an ASP.NET Pagep. 447
Taking Advantage of the Microsoft .NET Framework Configurationp. 449
Viewing an Application's Assembly Specificsp. 451
Programming ASP.NET Solutionsp. 454
Creating and Running a Simple ASP.NET Pagep. 456
Implementing a Simple ASP.NET Page Using C# and Visual Basic .NETp. 458
Creating and Running an ASP.NET Project in Visual Studiop. 460
Coding Changes You Must Make as You Migrate from ASP to ASP.NETp. 463
Taking Advantage of Cookies in an ASP.NET Pagep. 465
Determining a Browser's Capabilitiesp. 467
Maintaining ASP and ASP.NET Pages Side by Sidep. 469
ASP and ASP.NET Cannot Share Application and Session Objectsp. 471
Viewing HTTP Header Informationp. 476
Taking Advantage of Key ASP.NET Page-Based Methodsp. 479
ASP and ASP.NET Treat Form.Request and Form.QueryString Differentlyp. 480
Handling Exceptions in ASP.NET Pagesp. 484
Taking Advantage of ASP.NET Configuration Filesp. 488
Implementing a Custom-Error Pagep. 489
Improving Performance by Disabling Debug Operationsp. 490
Specifying Application- and Session-Specific Processingp. 492
Taking a Closer Look at the Page Directivep. 492
Fine-Tuning ASP.NET Cache Attributesp. 494
Importing a Namespace Using the Imports Directivep. 495
Programming Windows Servicesp. 500
Building a Simple Windows Servicep. 502
Installing and Removing a Service in Windows 2000p. 509
Taking a Closer Look at the ServiceBase Classp. 511
Writing Service Events to the Windows Event Logp. 514
Directing a Service to Perform Operations at Specific Time Intervalsp. 516
Taking Advantage of Threads to Process Service Operationsp. 519
Notifying the Administrator of Critical System Eventsp. 522
Integrating a FileSystemWatcher into a Web Servicep. 526
Programming Web Formsp. 530
Programming the asp:Button Controlp. 533
Programming the asp:Checkbox Controlp. 536
Programming the asp:CheckboxList Controlsp. 539
Programming the asp:RadioButton Controlp. 541
Programming the asp:Hyperlink Controlp. 543
Programming the asp:Image Controlp. 545
Programming the asp:ImageButton Controlp. 548
Programming the asp:Label Controlp. 550
Programming the asp:TextBox Controlp. 552
Programming the asp:Panel Controlp. 555
Programming the asp:DropDownList Controlp. 557
Programming the asp:ListBoxp. 559
Programming the asp:RadioButtonList Controlp. 561
Programming the asp:Literal Controlp. 563
Programming the asp:PlaceHolder Controlp. 564
Programming the asp:Calendar Controlp. 566
Programming the asp:Rotator Controlp. 567
Programming the asp:XML Controlp. 569
Programming the asp:RequiredFieldValidator Controlp. 570
Programming the asp:RangeValidator Controlp. 573
Programming the asp:CompareValidator Controlp. 576
Programming the asp:CustomValidator Controlp. 578
Programming the asp:RegularExpressionValidator Controlp. 580
Taking Advantage of HTML Server Controlsp. 582
Programming Web Servicesp. 586
Creating Your First Web Servicep. 588
Creating a Simple Date/Time Web Servicep. 593
Writing a Web Service that Uses Parameter-Based Methodsp. 595
Using an HTML Form to Interact with a Web Servicep. 597
Creating a Proxy for Your Web Servicep. 598
Using a Web Service from Within an ASP.NET Pagep. 601
Looking Behind the Scenes at Your Service's Web Service Description Languagep. 602
Handling Exceptions in Web Servicesp. 604
Leveraging the Web Service Configuration Filesp. 605
Looking Behind the Scenes at Your Web Service's SOAPp. 606
Building a Proxy Using WSDL.EXEp. 606
Changing the Web Service Namespacep. 609
Helping Others Discover Your Web Servicep. 609
Getting Started with ADO.NETp. 612
Specifying a Data Providerp. 613
Issuing a Query Using a DataReader Objectp. 615
Issuing a Query Using a DataSet Objectp. 617
Handling Data Set Updates Behind the Scenesp. 618
Querying a Database about Its Tablesp. 620
Querying a Table about Its Columnsp. 622
Viewing the Underlying XML Contentp. 623
Building a Data Set from an XML Filep. 625
Performing a Query Using an ASP.NET Pagep. 628
Displaying a Database Table in a DataGrid Controlp. 631
Programming .NET Reflection and Program Attributesp. 634
Revisiting .NET Reflectionp. 635
Viewing Class Information in ILDASMp. 638
Revisiting an Object's Methodsp. 640
Taking a Closer Look at an Object's Methodsp. 644
Contrasting Early and Late Bindingp. 646
Invoking an Object Method Using Invokep. 649
Taking a Closer Look at an Assemblyp. 652
Making Sense of [left angle bracket]Attributes[right angle bracket]p. 653
Defining a Custom Attributep. 654
Displaying an Assembly's Attributesp. 656
Indexp. 657
Table of Contents provided by Syndetics. All Rights Reserved.

ISBN: 9780072223187
ISBN-10: 0072223189
Series: Tips & Techniques
Audience: Professional
Format: Paperback
Language: English
Number Of Pages: 708
Published: 29th May 2002
Publisher: McGraw-Hill Education - Europe
Country of Publication: US
Dimensions (cm): 23.5 x 19.1  x 3.5
Weight (kg): 1.2