This is a one-line C# method that checks whether a string is a numerical value or not, by having regex (regular expressions) match a decimal with or without a floating point.
Get Unix Time using C#
While interfacing with Unix applications, your C# application might need to use Unix time instead of the standard date/time format. Since the Unix time format is basically a count of the seconds passed since 1/1/1970, this can be easily done using the DateTime object.
Draw Rounded Corner Rectangles Using C#
Use the GDI library objects to draw rectangles that have rounded rectangles of a specified radius. The secret is to use a series of lines and arcs to form the rectangle as desired.
Checksum CRC32 Calculator
A C# method for calculating the CRC32 checksum on an array of bytes. The code uses a CRC32 table and makes use of C#’s bitwise operators to return the checksum of the bytes passed.
Draw rounded corner rectangles
The RoundedCornerRectangle() method uses the GDI+ class to draw rectangles with rounded corners. It draws the graphic to a Graphics object that was passed to the method.
Put a string into byte array
The StringToByteArr() is a two line function that puts a string into a byte array, often needed in order to transfer a string via a network.
Capitalize each word in a string
The CapitalizeString method uses regular expressions to capitalize every word in a string.
Get a list of installed printers
Using a foreach loop in C# to retrieve a list of all installed printers (available or unavailable.)
Encrypting a string using the MD5 algorithm
Method for resizing pictures with aspect ratio
The GenerateThumbnail() C# function resizes pictures for various formats, such as JPEG, PNG and BMP, and maintains their aspect ratio.