VB.NET Sample Code
-
Making a .NET app run on Vista with Administrator priviledges
by James Crowley
If you're targeting Windows Vista and your application requires administrator priviledges (such as accessing the program files directory), then it will fail unless you include a manifest so Windows knows. Here's how.
-
User-Friendly Validation using ErrorProvider
by Tim Dawson
Data entry is a very important part of a lot of applications. It is important to validate data as it is entered without disturbing the user. Enter the ErrorProvider component.
-
Generate an Image of a Web Page
by Alan Dean
Demonstrates how to fetch images and thumbnails of web pages using a hidden web browser control.
-
Is an Internet Connection Available?
by Karl Moore
Check if an internet connection is available using this simple code snippet.
-
Convert Decimal Integer Values to Binary String in VB6
by Alex Etchells
A small function to convert decimal integer values to a binary string. The number of bits can be optionally specified but this will be increased if insufficient.
-
Random Numbers... That Work!
by Karl Moore
Has all this talk about seeds got you confused? Here's a nice snippet to show you the best way to get random numbers in .NET.
-
How to access a MySQL database with .NET
by Edward Tanguay
Demonstrates how to connect to a MySQL database with C#.
-
Double buffering in .NET
by Simon Soanes
Ever wondered how to double buffer with a Graphics object so your GDI+ based game/control doesn't flicker annoyingly? Here's how!
-
Parse a UK Date String
by James Crowley
Ever wondered why DateTime.Parse doesn't recognise non-US date format? Here's how to get it to!
-
Date And Time Validation Functions
by Hari K
This function is used for VB.Net developers. It is useful for Date validate when the date format is "dd/MM/yyyy" or "dd/MMM/yyyy". Time validation is also useful for Validating the given time in the format of "HH:mm:ss"
-
Execute a Process and Fetch its Output
by James Crowley
Demonstrates how to redirect the output of a shell program (such as a batch file) so you can fetch the text it returns.
-
String Concatenation
by James Crowley
How to join/append two strings together in VB
-
The Trick to Temporary Files
by Karl Moore
Karl Moore reveals how to save temporary files in... the temp directory!
-
Screen Resolution
by Bharat Nagarajan
Helps you to get the screen resolution from VB.NET
-
VB Express Color Object to Hex String
by Chris Buske
This function takes one color type variable and returns the hex code in a string.
-
Spoofing the Referrer using HttpWebRequest
by Dave Wanta
Here's a simple way to spoof the referrer to a web page during a web request.
-
Clearing TreeView taking too much time
by Palo Mraz
Explores an odd feature of the System.Windows.Forms.TreeView and a simple workaround.
-
How to run through multiple DataReader results
by Edward Tanguay
You can save code by piling SQL statements into one SqlCommand and then getting a DataReader with multiple result sets.
-
Are You Running in the IDE?
by Karl Moore
Here's how to detect if your .NET code is currently being debugged, or if we're in design mode.
-
How to empty a recycle bin
by Peter Rekdal Sunde
Here is a little snippet that allows you to clean your recycle bin without any confirmation from the user, no progress ui and the sound is removed.