|
IsValidUsPhoneNumber - Validating a US phone number
|
Total Hit (2988) |
«Code LangId=2»
' Validate a US phone number
' Example:
' MessageBox.Show(IsValidUsPhoneNumber("(123) 456-7890")) ' True
' MessageBox.Show(IsValidUsPhoneNumber("(123) 456-78901")) ' False
Function IsValidUsPhoneNumber(ByVal phnNum As String) As Boolean
Return System.Text.RegularExp
....Read More |
Rating
|
|
|
|
|
|
|
|
Determine how many records the DataReader is about to return
|
Total Hit (2699) |
The DataReader is the ADO.NET counterpart of the forward-only, read-only recordset in classic ADO. For this reason you never know how many rows the DataReader is about to return. In most cases you don't need this information, because you tipically process each row as soon as it is being returned, an
....Read More |
Rating
|
|
|
Settings pre and post-build actions in VS.NET 2003
|
Total Hit (2543) |
VS.NET 2003 comes with a nice feature that allows you to automatically run an external executable file before or after a build. For example, you may want that after a build a Windows Explorer window is automatically opened on the output folder, so that you can easily run the compiled program. Or you
....Read More |
Rating
|
|
|
Control what happens when an unhandled exception occurs
|
Total Hit (2983) |
By default, when an unhandled exception occurs in a managed application, a dialog box appears that asks you whether you want to debug the application with one of the debuggers that are listed in a listbox. (Notice that Windows Forms applications display a different dialog box.)
The behavior of th
....Read More |
Rating
|
|
|
EvaluateModule - a module for evaluating expressions
|
Total Hit (2582) |
«Code LangId=2»' A module for evaluating expressions, with support for
' parenthesis and many math functions
' Example:
' Dim expr As String = "(SQR(9)^3)+COS(0)*3+ABS(-10)"
' txtResult.Text = Evaluate(expr).ToString ' ==> 27+3+10 ==> 40
Imports System.Text.RegularExpressions
M
....Read More |
Rating
|
|
|
|
|
CompareValue - Check whether a value is in a list of values
|
Total Hit (2702) |
«Code LangId=2»' Compares a numeric or string value with a list of other values.
' Returns the 1-based index of the matching value, or zero if the
' value doesn't appear in the list.
' String comparisons are case-sensitive.
'
' This function can conveniently replace a Select Case or a list
'
....Read More |
Rating
|
|
|
|
|
Transform a variable into a Property
|
Total Hit (2598) |
Thanks to Visual Studio.NET macros, it is quite simple to automate the task of transforming a Public field into a Property with the same name that accesses a private field of the same type.
Press Alt-F11 (or invoke the Macro IDE from the Tools|Macros submenu, select one macro module in the left-m
....Read More |
Rating
|
|
|
|
Tutorial - Introduction to Microsoft.net
|
Total Hit (9440) |
«a name=#L1»«/a»
«big»Introduction«/big»
This tutorial series is intended to initiate the reader into the world of .NET. I will try to cover most of the important .Net features. This tutorial will be useful for anyone with a programming background, especially for those who know VB.
There ar
....Read More |
Rating
|
|
|
ReverseString - Reversing a String
|
Total Hit (1624) |
«Code LangId=2»
' Reverse the input string, without using the StrRever function in the VB6
' compatibility assembly
Function ReverseString(ByVal source As String) As String
Dim chars() As Char = source.ToCharArray()
Array.Reverse(chars)
Return New String(chars)
End Function
«
....Read More |
Rating
|
|
|
ADO.NET: Handle Errors
|
Total Hit (1100) |
In addition to Try/Catch and exceptions, the new ADO.NET data architecture allows you to add error messages to each row of Data in a DataSet. SqlDataAdapters attach error messages to Rows if updates or other actions fail. Furthermore, you can filter for rows in error to present them to the user, or
....Read More |
Rating
|
|
|
Multithreading in VB.NET
|
Total Hit (1556) |
In past developing multithreaded applications in VB was tedious task. Many times spawning new threads actually spawn errors :-) The picture has changed in VB.NET. VB.NET now has simplicity of Java while dealing with threads. We will see a simple example of running your code in a separate thread in f
....Read More |
Rating
|
|
|
|
Picking Out Delimited Text with Regular Expressions
|
Total Hit (1721) |
Have you ever wanted to parse an HTML document and be able to easily grab the text between certain text delimiters? For example, imagine that we wanted to list all the text in an HTML document that falls within any bold tags (<b> ... </b>). Or say that we wanted to grab the text (if any) that was th
....Read More |
Rating
|
|
|
Creating and Modifying Shortcuts
|
Total Hit (1732) |
This article provides a .NET class wrapper around the ShellLink object which enables you to read, create and modify Shortcuts under any version of Windows. As a bonus, you also get an Icon Picker implementation which demonstrates how to extract all the Windows icon resources from any executable or D
....Read More |
Rating
|
|
|
How Do I...Get the types in an assembly?
|
Total Hit (1001) |
This sample illustrates how to retrieve all the types for a given assembly. To look through the types of an assembly, you first need to identify the assembly you want to manipulate. Once you have an object reference to the assembly of interest, you can call the GetTypes method on that assembly, whic
....Read More |
Rating
|
|
|
The implementation of Flags using bitwise operators
|
Total Hit (1010) |
Bitwise operators give you the ability to store multiple settings in a single primitive data type (e.g. an integer). This is useful when a single item has potentially more than one setting of the same type. For example, a message box could have an Ok button, a Cancel button, a Retry button or any co
....Read More |
Rating
|
|
|
How Do I...Use tracing switches and listeners?
|
Total Hit (891) |
Trace instrumentation allows developers and administrators to monitor the health of applications running in real-life settings (as opposed to running in a debugger). Sometimes using a debugger can hide bugs and obscure some performance and threading problems. Tracing is a very important monitoring a
....Read More |
Rating
|
|
|
How do I create an XML Schema Definition (XSD) File From a Class?
|
Total Hit (1016) |
This topic describes how to build an XSD file for classes that you save and load from XML using the XML Serialization classes. The XML Serialization classes allow you to serialize an object as XML . Often you will start with an XML Schema Definition (XSD) file, and use the XSD.exe tool to build the
....Read More |
Rating
|
|
|
How Do I...Watch file system changes?
|
Total Hit (714) |
Use the FileSystemWatcher component to monitor a file system and react when changes to it occur. This makes it possible for you to quickly and easily launch business processes when certain files or directories are created, modified, or deleted. For example, suppose you and a group of coworkers are c
....Read More |
Rating
|
|
|
A Google-like Full Text Search
|
Total Hit (4486) |
Thanks to Internet search engines like Google and Yahoo!, your search application users are more sophisticated and demanding than ever. Your application users have a wealth of search application knowledge that they're probably not even aware of. Ask one of them to find a website dedicated to their f
....Read More |
Rating
|
|