Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.
VB.NET Programming Hacks - 100+ List
From Wiki
This is a collection of hacks and good to know things about .Net. Things of which you think "if only I had known that".
Since this a desktopdeveloper category I will concetrate on Windows forms and later perhaps WPF. Add to this list if you like
We will split them up in categories.
Contents [Hide] |
General
* Aliassing a namespace * Memory usage for all processes * Get the commandline parameters * Get the computername * Getting text from the clipboard * Saving text on the clipboard * Getting the freespace on a drive * Getting memoryusage of one process * Get the total space used by a drive * Path to UNC * Impersonating an administrator * Programaticaly changing the Ignore addresses in the proxy settings
Strings
* Use StringBuilder to concatenate strings
Dates
* Add day, month, year to date * Add time to a date (hours, minutes, seconds) * Substract Time from a date (hours, minutes, seconds) * Substract from a date (days, months, years) * What day of the week is a certain date * Is this year a leapyear? * Difference in days between 2 dates
ADO.NET
* Use commandparameters instead of string concatenation
Forms
* Opening a form on a specified monitor * Show a form in a form * Open a form as modal * Open a form * MDI * Hide a form on closing
Controls
* Use TextBox.AppendText instead of concatenating strings
linq
* Using Linq to Order directories by creation datetime
xlinq
* Xlinq : get an elements value with VB.Net * Xlinq: write to an element using VB.Net
Reflection
* Getting a property using reflection part 1 * Getting a property using reflection part 2 * Getting a property using reflection part 3 * Getting a property using reflection part 4 * Create an instance of class from a string using reflection * Set a readonly property via reflection * Setting a private field using reflection * Getting a private field using reflection
Patterns
* Use Singletonprovider instead of the Singleton pattern * Invoke Singletonprovider giving a string as classname
Network
* See if the network is available * Pinging another computer * Getting the current computer's IP-Address * Determining if an IPAddress is IPv4 or IPv6 * Creating an IPv6 address the correct way * How to create an IPv4 address the correct way
Printing
* Selecting a printer
Numbers to Words
* Numbers to French words * Numbers to Dutch words
* Sending a mail with attachements
File handling
* Checking if a file exists * Deleting a file * Checking if a directory exists * Deleting a directory * Get all the files from a certain directory * Get all the files with a certain extension from a directory * Getting a file's extension from a string * Getting a file's filename from a string * Getting a file's filename from a string without the extension * Combining two strings to make a path



LTD Social Sitings
Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.