C# Examples

This page lists some console utilities (and one GUI based utility) I wrote in C#.

To allow using them in batch files, most utilities return their results as errorlevels.
Check the source code and the command line help text to translate the return codes/errorlevels back to results.

Some of these utilities were tested in Windows XP, all of them in Windows 7.
They were compiled with Visual Studio 10 Express Edition, with the target framework set to .NET Framework 4 Client Profile.

Download the program Click a download icon to download the program.
ZIP file's checksums Click a check mark icon to view the ZIP file's MD5 and SHA1 checksums.
View program's help text Click a question mark icon to view the program's help text.
  Click the program name to view its source code.

 

C# Examples
Click a download icon to dowload the program Click a check mark icon to view the ZIP file's MD5 and SHA1 checksums Click a question mark icon to view the program's help text Name Version Description Last modified Remarks
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text Asc 1.00 Return the decimal character code for the specified ASCII character 2012-05-11  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text ASCII 1.00 Convert text from a file or standard input into ASCII and send it to standard output 2014-01-30 As there are many "standards" to choose from when encoding text to Unicode, this tool may sometimes fail and return garbled text. In that case, try Unicode2ASCII instead.
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text BatCodeCheck 0.32.1 Batch Code Check: search batch source code for unterminated quotes, parenthesis and variables, and a number of other common coding errors 2014-11-22 Still in beta!
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text BatHL 0.51 Batch HighLighter: search batch source code for unterminated quotes, parenthesis and variables, and a number of other common coding errors 2014-02-07 No longer supported, use BatCodeCheck instead
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text CameraModel 2.00 Return the camera model for the specified image file 2012-10-16 This utility searches only the first kilobyte of the specified image file, which makes it a lot faster than FINDSTR or STRINGS.
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text CanonModel 1.00 Return the Canon camera model for the specified image file 2012-10-07 This utility searches only the first kilobyte of the specified image file, which makes it a lot faster than FINDSTR or STRINGS.
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text CapsLock 1.01 Read or set CapsLock key state 2012-06-28  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text CaptureDate 1.00 Return the capture date and time for the specified image file 2013-02-13 This utility searches only the first kilobyte of the specified image file, which makes it a lot faster than FINDSTR or STRINGS.
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text Chr 1.00 Return the ASCII character for the specified decimal character code 2012-05-10  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text ClCalc 1.01 Command Line Calculator 2014-03-25 Based on code by "markman", found in a discussion section of CodeProject.com.
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text CloneDate 0.50 BETA Modify the LastModified date (timestamp) of the target file(s) to match the specified source file's timestamp 2012-07-19  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text DateTimeBox 1.02 Batch tool to present a Date/Time Picker dialog and return the selected date and/or time in the specified format 2014-10-12 Inspired by code from Gorkem Gencay on StackOverflow.com.
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text Drives 2.00 List available and/or used drive letters 2012-06-25 Based on code found at DreamInCode.com.
Unlike ListDrives.exe, Drives.exe does not require elevated or administrative permissions.
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text FastPing 1.00 Faster PING alternative 2012-09-25  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text GetMyPID 1.00 Return the parent process' PID. 2011-05-16 Requires ParentProcess.cs by Jared Barneck
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text GetTitle 4.00 Read the current Window's title, optionally removing the "Administrator:" prefix if running with elevated privileges (Vista and later), and optionally removing the appended command line. 2011-05-10 As of version 4.00, GetTitle works in "all" Windows versions, rendering GetTitleXP, the separate XP version, obsolete.
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text HideInput 1.00 Read 1 line of keyboard input while hiding what's being typed, by temporarily setting the console foreground color equal to its background color. 2012-09-29  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text InputBox 1.22 Batch tool to prompt for input (GUI) 2014-10-01 Most of the code comes from Gorkem Gencay on StackOverflow.com.
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text is6432os 1.00 Return "errorlevel" 64 if current OS is 64-bit, or 32 if it is 32-bit 2010-07-04  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text isDST 1.01 Return "errorlevel" 0 if a date is in Daylight Saving Time, or 2 if it isn't 2012-06-28  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text IsElevated 1.00 Return "errorlevel" 0 if current process has elevated privileges, or 1 if not 2011-01-03  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text IsFAT 1.00 Return "errorlevel" 0 if the specified drive is FAT formated, 2 if not, or 1 if not ready 2011-04-22  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text IsNTFS 1.00 Return "errorlevel" 0 if the specified drive is NTFS formated, 2 if not, or 1 if not ready 2011-04-22  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text IsRedirected 1.01 Return a number containing the redirection status of StdIn (+2), StdOut (+4) and StdErr (+8) 2012-06-19  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text ListDrives 1.10 Return a string containing all drive letters in use 2011-04-06 Unlike Drives.exe, ListDrives.exe requires elevated or administrative permissions.
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text ListIntCmd 1.05 List all available internal commands 2014-12-09  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text ListNICs 1.00 List physical network adapters 2011-11-01  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text ListPrinters 1.10 List all available local printers 2011-04-06  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text LoCase 2.00 Convert filenames to all lowercase 2014-12-05  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text MessageBox 1.20 Batch tool to show a message in a MessageBox and return the button clicked 2014-09-24  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text NewTempFile 1.00 Create a zero-byte temporary file and display its name on screen 2012-07-02  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text NumLock 1.01 Read or set NumLock key state 2012-06-28  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text ODT2PDF 1.00 Save LibreOffice/OpenOffice Writer files as PDF 2014-01-28 Requires LibreOffice/OpenOffice, its SDK and a 32-bit Java runtime.
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text OpenFileBox 1.01 Batch tool to present an Open File dialog and return the selected file path 2014-08-28  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text OpenFolderBox 1.01 Batch tool to present a Browse Folders Dialog and return the selected path 2014-09-16  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text Paste 2.00 Read text from clipboard and write to file or screen 2014-08-20  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text PDFPageCount 1.02 Return the page count for the specified PDF file(s) 2011-10-13 Based on sample code by Dharmaraj Nagarajan
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text PingSite 1.21 Check if a website is up and running 2011-10-18  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text PrintAny 3.01 Print files using the print command or verb registered for the file type 2012-11-13 Not all file types have registered Print(To) commands or verbs
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text PrinterSelectBox 2.00 Batch tool to present a Select Printer dialog and return the selected printer 2014-09-03 Inspired by code from Gorkem Gencay on StackOverflow.com.
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text Printing 2.31 Pause or resume printing, or flush all queued printjobs on the specified printer(s), or list all printers, their status and number of printjobs 2012-12-21 Requires PrinterInfo.cs by Bas van der Woude
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text PrintScreen 1.00 Save a screenshot as image or save the current console buffer as text 2012-10-02 Credits: Code to read console buffer by Simon Mourier; code for graphic screenshot by Ali Hamdar
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text ReadLine 0.30 beta Read the specified line(s) from a text file or from standard input 2012-05-19  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text RxGrep 2.00 Multi-line FindStr/Grep like tool 2012-12-11 See the FINDSTR page for a usage sample
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text RxReplace 1.00 Multi-line regex find and replace tool 2014-12-04  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text SaveFileBox 1.00 Batch tool to present a Save File dialog and return the selected file path 2014-08-28  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text ScrollLock 1.01 Read or set ScrollLock key state 2012-06-28  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text SplitTextFile 0.50 beta Split a large file into smaller chunks 2013-11-08  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text StringHash 1.01 Return the MD5 or SHA* hash value for the specified string 2010-07-29  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text Tail 1.01 Return the specified number of lines from the end of the specified file 2013-11-19 Code to detect redirection by Hans Passant on StackOverflow.com.
Code to detect file encoding by Jason Pierce on StackOverflow.com.
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text Tee 1.02 Redirect Standard Input to Standard Output and to a file 2012-07-11 Code to detect redirection by Hans Passant on StackOverflow.com.
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text TranslateCulture 1.00 List translations for weekdays and/or month names for the specified cultures (languages) 2011-05-18  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text Unicode2ASCII 1.00 Convert text from a file or standard input into ASCII and send it to standard output 2014-01-30 As there are many "standards" to choose from when encoding text to Unicode, this tool may sometimes fail and return garbled text. In that case, try ASCII instead.
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text UpCase 2.00 Convert filenames to all uppercase 2014-12-05  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text WaitASecond 1.00 A 900..1100 milliseconds random time delay 2011-05-11  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text WANIP 1.02 Get the computer's WAN IP address 2011-06-27  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text WGetLite 1.00 Get web content (text only) 2011-04-14  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums Click the question mark icon to view the program's help text Which 1.45 Port of the UNIX command to Windows 2014-12-15  
Click the download icon to dowload the program Click the check mark icon to view the ZIP file's MD5 and SHA1 checksums   Wireless 1.00 Monitor an 802.11 wireless connection 2012-07-06 This is a GUI based program, not a command line utility.
Works in XP only.

 


page last uploaded: 5 December 2014, 13:10