|
|
A general benchmarking class
|
Total Hit (2914) |
Many times we need to benchmark some routine or a block of code. This class will help you to benchmark a routine or a block of code.
«code LangId=2»Public Class BenchMark
Delegate Sub BenchmarkDelegate()
Enum BenchmarkModes
DontShow
Console
MessageBox
End
....Read More |
Rating
|
|
|
Create zero-elements arrays
|
Total Hit (2563) |
The .NET framework lets you create two types of "empty" arrays: unitialized arrays and arrays that are initialized with zero elements. Uninitialized arrays are actually array variables that are set to Nothing, whereas zero-element arrays are non-Nothing variables that point to arrays with zero eleme
....Read More |
Rating
|
|
|
Determine how many records the DataReader is about to return
|
Total Hit (2941) |
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
|
|
|
Dec2Any - Convert a decimal number to any other base
|
Total Hit (3963) |
«Code LangId=2»' convert a positive number to any base
' BASE can be in the range 2-36
Function Dec2Any(ByVal number As Long, ByVal base As Short) As String
Dim index As Integer
Dim digitValue As Integer
Dim res As New System.Text.StringBuilder()
Const digits As String = "0
....Read More |
Rating
|
|
|
How Do I... Work with tracing?
|
Total Hit (2199) |
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
|
|
|
|
|
|
Copy Directory Content and All subfolders to target path
|
Total Hit (11355) |
This Code will copy all files and subfolders of specified source directory to target location
«code LangId=2» Sub CopyDirectory(ByVal SourcePath As String, ByVal DestPath As String, Optional ByVal Overwrite As Boolean = False)
Dim SourceDir As DirectoryInfo = New DirectoryInfo(SourceP
....Read More |
Rating
|
|
|
Setting up multiple start-up projects
|
Total Hit (2420) |
By default, a solution has a single start-up project, namely the project that is automatically launched when you click Debug | Start or press F5. However, you have the option to start multiple projects of the solution when you call Start, something that is very useful to automatically start, in debu
....Read More |
Rating
|
|
|
|
CompareList - Compare an argument with a list of values
|
Total Hit (2567) |
«Code LangId=2»' Return the position of the argument in a list of values
' or zero if the argument isn't included in the list
' It works for both regular values and for objects
'
' This handy function can often save you a lengthy Select Case
' statement or a complex series of If...ElseIf block
....Read More |
Rating
|
|
|
|
|
All about .NET Assemblies, GAC, Manifests and Deployment
|
Total Hit (3427) |
A .NET application is composed of three primary entities: assemblies, modules and types. An Assembly is the primary unit of deployment. The individual files that make up a .NET application are call modules. Types are the basic unit of encapsulating data and behavior behind an interface composed of
....Read More |
Rating
|
|
|
|
|
|
Launch another process in a specified directory
|
Total Hit (2698) |
The System.Diagnostics.Process class provides several methods to launch and controls other Windows processes. For example, the following code sample shows how to run Notepad, pass arguments to it, and run it from inside a given intial directory:
«Code LangId=2»
' this code assumes that you have
....Read More |
Rating
|
|
|
|
ADO.NET: Execute a Command
|
Total Hit (845) |
Commands are issued against databases to take actions against data stores. For example, you could execute a command that inserts or deletes data. For more information on moving data into and out of databases, see "Update a Database from a DataSet". Commands include any command that can be issued aga
....Read More |
Rating
|
|
|
Floating Controls, Tooltip-style
|
Total Hit (2361) |
This article started when I was implementing the VS.NET ListBar control. If you move the mouse over an item whose text is partially obscured in the VS.NET ListBar, a popup appears to show more of the text. The same technique is also implemented in the ListView and TreeView controls using a ToolTip.
....Read More |
Rating
|
|
|
System Image List
|
Total Hit (2515) |
Although you can easily extract copies of icons for any file from the Shell using the SHGetFileInfo call, if you need to be able to display the icon for a large number of files you can end up with too many icons and run out of resources. The System Image List uses an intelligent caching technique to
....Read More |
Rating
|
|
|
How Do I...List all the members of a type?
|
Total Hit (1081) |
This example lets you list the members for a given data type. The ability to list a type's members is a great way to quickly discover which elements are available. It is an important tool for reporting on your system as well as assisting in the development of user documentation. Using the Reflection
....Read More |
Rating
|
|
|
How Do I...Build a .NET Client That Uses a COM Server?
|
Total Hit (823) |
This section explains how to build managed code that uses COM. The steps involved in the build process are as follows:
«LI»Obtain an assembly containing definitions of the COM types to be used.
«LI»Install the assembly in the global assembly cache. (optional)
«LI»Reference the assembly conta
....Read More |
Rating
|
|
|
Painting in the MDI Client Area
|
Total Hit (2347) |
Although the .NET Framework Form allows you to set a background bitmap or color for the MDI Client area, there's no direct way to draw onto the area to customise it. This sample demonstrates how to create an object which derives from NativeWindow to intercept the messages from the MDI Client area an
....Read More |
Rating
|
|
|
ADO.NET: Update a Database from a DataSet
|
Total Hit (587) |
This topic illustrates how to update data in a database using a DataSet. It is important to remember that you can also insert, update, and delete data in a database directly using a SqlCommand. Understanding the concepts covered in Populate a DataSet from a Database will help you understand the curr
....Read More |
Rating
|
|
|
Introduction to .NET Reflection
|
Total Hit (1236) |
Reflection is ability to find information about types contained in an assembly at run time. Prior to .NET languages like C++ provided such ability in a limited sense. .NET provides a whole new set of APIs to introspect assemblies and objects. All the APIs related to reflection are located under Syst
....Read More |
Rating
|
|
|
Microsoft Beefs Up VBScript with Regular Expressions
|
Total Hit (1224) |
In this article, I'll describe all objects related to VBScript Regular Expressions, summarize common regular expression patterns, and provide some examples of using regular expressions in code.
|
Rating
|
|