|
How to compress files and data in VB.net
|
Total Hit (3674) |
<b>"Compressing files and data",</b><br>
<a href="http://dotnet.mvps.org/dotnet/faqs/?id=compression&lang=en">
http://dotnet.mvps.org/dotnet/faqs/?id=compression&lang=en</a><br>
<br>
Compressing files and data<br>
CAB format:<br>
Microsoft Cabinet Software Development Kit<br>
<a
....Read More |
Rating
|
|
|
Use a ParamArray as a true array
|
Total Hit (2698) |
Unlike VB6, in VB.NET the ParamArray keyword defines a true array object, which you can process using any of the methods of the Array class. For example, here' s a function that evaluates the lowest value among those passed to the procedure, using the static Array.Sort method and then taking the ele
....Read More |
Rating
|
|
|
|
|
How to check NULL value in .net ?
|
Total Hit (2863) |
IsNull() function of VB6 is not supported in VB.net to check NULL value but there is alternate way to do that
«Code LangId=2»
If rs("Myfield") IS System.DBNull.Value Then
Msgbox("It is NULL")
Else
Msgbox("It is not NULL")
End if«/Code»
|
Rating
|
|
|
Creating custom help filters
|
Total Hit (2722) |
If you open the VS.NET documentation (either from within the IDE or by clicking the respective icon under the Start | Programs| Microsoft Visual Studio 2003 folder) you can use the Filtered by dropdown box to select a filter, and load in the list/tree control below only the subset of topics you're i
....Read More |
Rating
|
|
|
Determine whether an API function is available
|
Total Hit (3455) |
In many cases you may want to call an API function, but you aren't sure whether the Windows version the application is running on supports that particular function.
The easiest way to test whether a function exists and can be called is to replicate through VB code what Windows itself would do whe
....Read More |
Rating
|
|
|
How to configure control licensing
|
Total Hit (2952) |
The .NET Framework has a licensing model identical for all types of components and
controls that is fully compatible with the licensing rules used for ActiveX controls.
Developing and Implementing Windows-Based Applications with Microsoft Visual Basic .NET and Microsoft Visual Studio .NET
Licensi
....Read More |
Rating
|
|
|
Right-align formatted strings
|
Total Hit (3313) |
The String.Format function supports many formatting options, but none allows you to display right-aligned columns of numbers, as in:
1.00
12.00
123.00
1,234.00
However, you can easily create a helper function that works like String.Format, takes an additional length argument,
....Read More |
Rating
|
|
|
FormatValue - Format a value in a column of given width
|
Total Hit (2714) |
«Code LangId=2»
Enum FormatColumnAlignment
Left
Center
Right
End Enum
' format a value in a column of given width and with specified alignment
' using the specified pad character
Function FormatValue(ByVal value As String, ByVal width As Integer, _
ByVal alignment As F
....Read More |
Rating
|
|
|
Create a Touch utility
|
Total Hit (3187) |
The SetCreationTime, SetLastWriteTime, and SetLastAccessTime methods of the System.IO.Directory class let you modify the date attributes of a file or directory:
«Code LangId=2»
' Change the access date- and time of all files in C:\DOCS.
For Each fname In Directory.GetFiles("c:\docs")
File.
....Read More |
Rating
|
|
|
Adding events dynamically in a Windows Form
|
Total Hit (2877) |
The new AddHandler statement makes it possible to attach event dynamically, that is without having to bind them via static code based on the Handles keyword. This keyword is also useful to have all the controls on a form share the same event procedure.
For example, say that you want to change th
....Read More |
Rating
|
|
|
HTML Color Coding for various Languages (i.e. VB, VB.net, SQL).
|
Total Hit (10633) |
I spent several hours to find some article to convert Source Code into HTML with different colorcode for keywords/literal/comment/function. But no luck and finally I wrote my own ColorCoding Engine. This article will show you how you can utilize power of Regular Expression to solve your very complex
....Read More |
Rating
|
|
|
Write a console utility to list processes
|
Total Hit (4068) |
The Process class provides all you need to create a command-line utility that lists all the processes running on the system and all the related information. This utility is therefore similar to the Windows Task Manager, except you can run it from the command prompt. All processes are sorted alphabet
....Read More |
Rating
|
|
|
Get Mouse Position Anywhere, Anytime
|
Total Hit (3822) |
Some control events provide the mouse pointer's current position within the control's client area; others provide only the screen coordinates of the mouse pointer (the same as returned by Cursor.Position). Is there a function that tells you where the mouse is positioned within a specific control? We
....Read More |
Rating
|
|
|
|
|
The DataTable's Compute method
|
Total Hit (3060) |
The DataTable class has a method, Compute, that executes SQL-like functions on the rows locally stored in the DataTable. It supports functions such as COUNT, SUM, MIN, MAX, AVG and others. Here's an example to calculate the average salary for the employees stored in the tableEmployees DataTable:
....Read More |
Rating
|
|
|
Pasting data from the Clipboard
|
Total Hit (6256) |
Pasting data from the clipboard requires more code because you must ascertain whether the clipboard contains data in one of the formats you're willing to process. First, use the Clipboard.GetDataObject to retrieve an IDataObject object. Next, use the GetDataPresent method of this IDataObject object
....Read More |
Rating
|
|
|
Mail Tutorial in VB.NET
|
Total Hit (3290) |
Microsoft has made life more easy by adding an in-built .NET class for SMTP Mail. This article will show you how you can take advantage of System.Web.Mail namespace in VB.Net
«B»Basic Mail Message«/B»
«Code LangId=2»
Imports System.Web.Mail
Dim m As New System.Web.Mail.MailMessage()
Wi
....Read More |
Rating
|
|
|
|
Working with OwnerDraw Menus in VB.NET
|
Total Hit (2031) |
When a menu is constructed with the VS IDE menu editor, it's very easy to add menu items and set up the hierarchy of the menu structure. Using just a few mouse clicks and a few keystrokes, your whole menu structure can created in just a few minutes. "So", you may ask, "how do we get these cool image
....Read More |
Rating
|
|
|
Associations
|
Total Hit (1602) |
Applications such as WinZip add new items to Explorer's File and context menus for all files and folders on the system. Although WinZip uses Shell Extensions to achieve this, it is much easier to do using verbs. This article demonstrates how to use the .NET Registry classes to add new shortcut verbs
....Read More |
Rating
|
|
|
Welcome to Visual Basic .NET
|
Total Hit (2376) |
The goal of this book is to help you come up to speed with the Visual Basic .NET language even if you have never programmed anything before. We will start slowly, and build on what we learn. So take a deep breath, let it out slowly, and tell yourself you can do this. No sweat! No kidding! This secon
....Read More |
Rating
|
|
|
Formatting the Windows Forms DataGrid Control in Visual Basic
|
Total Hit (1028) |
Quite a few basic tasks related to formatting the Windows Forms DataGrid control require you to create and implement your own custom column styles. However, once you are familiar with these objects, you will have a lot of power at your disposal.
|
Rating
|
|
|
Simple Interprocess Communications using WM_COPYDATA
|
Total Hit (2297) |
Whilst the .NET Framework has some very sophisticated techniques for communication between processes on different machines, it doesn't provide so much support for communication between processes on the same machine. The Windows API offers a rich set of inter-process communications features, at vario
....Read More |
Rating
|
|
|
Walkthrough: Working with Offline SQL Server Data in Excel
|
Total Hit (1032) |
Microsoft Office Excel makes it easy to work with rectangular data, such as data from an external database. In this walkthrough, you'll load data from Microsoft SQL Server into an ADO.NET dataset. You'll then use the Excel object model to support synchronizing changes made to the data in Excel with
....Read More |
Rating
|
|
|
|
How Do I...Create a Remote Object as a Singleton?
|
Total Hit (819) |
This example demonstrates how to modify the Client/Server example by deploying the remote object as a singleton. The client starts two threads and calls the CountMe method on the server on two different channels: TCP and HTTP. Although this example is very simple, it does illustrate a few important
....Read More |
Rating
|
|
|
Manipulating Windows Event Log
|
Total Hit (1946) |
Windows Event Log keeps track of system wide and application level events. These events messages constitute things such as information messages, error messages, warnings and alerts. If your system is giving some troubles event log is the first place an administrator will look into. .NET framework pr
....Read More |
Rating
|
|