This C# application starts a new Command Prompt process, passes a command to it and retrieves the response from the command prompt without every displaying the window.
Get And Set The System Date And Time
C# code snippet that uses unmanaged code to retrieve the current date and time of the Windows operating system, and also sets it to the specified values.
Retrieve a list of disk drives using C#
This code retrieves a list of drives, stores it into an array of strings, and then loops through it to display the drives.
Calculate age using C#
An efficient C# method for calculating the age in years by passing in the birth date.
Taking Website Screenshots With The WebBrowser Control
Sample code on how to take screenshots of websites, resize them to thumbnails and save them as PNG file onto the harddrive.
Convert ASCII values from hex to characters
This C# code takes in a list of ASCII values (hexadecimal) and shows the actual characters behind, thus converting hex values to strings.
Delete All Temporary Internet Files Of IE
Delete all the temporary files from Internet Explorer’s cache folder using basic methods available in the System.IO namespace.
Validate String For Positive Integer Values
A very simple way to validate a string for positive integer values using C# and regular expressions.
How do I get the visitor’s IP address?
There are two possible ways, either using: or using Furthermore there is information that the below line retrieves the actual IP address and not the Proxy: However this hasn’t been tested yet.
How to get a list of SQL Server databases
There are multiple ways of getting a list of the SQL Server databases, the easiest one is to execute the sp_databases stored procedure, like in the example below: Don’t forget to change the connection string to match your server details (IP, userid and password).