C# Examples

This page lists some console utilities 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 the target framework set to .NET Framework 4 Client Profile.

 

Download the ZIPed sources Click the floppy disk icons to download the ZIPed sources

Checksums for the ZIPed sources Click the question mark icons to view the MD5 and SHA1 checksums for the ZIPed sources

 

C# Examples
Click the floppy disk icons to dowload the ZIPed sources Click the question mark icons to view the MD5 and SHA1 checksums for the ZIPed sources Name Version Description Last modified Remarks
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source CapsLock 1.00 Read or set CapsLock key state 2011-04-04  
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source GetMyPID 1.00 Return the parent process' PID. 2011-05-16 Requires ParentProcess.cs by Jared Barneck
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source 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 floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source is6432os 1.00 Return "errorlevel" 64 if current OS is 64-bit, or 32 if it is 32-bit 2010-07-04  
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source isDST 1.00 Return "errorlevel" 0 if a date is in Daylight Saving Time, or 2 if it isn't 2011-04-04  
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source IsElevated 1.00 Return "errorlevel" 0 if current process has elevated privileges, or 1 if not 2011-01-03  
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source 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 floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source 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 floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source IsRedirected 1.00 Return a number containing the redirection status of StdIn (+2), StdOut (+4) and StdErr (+8) 2011-03-28  
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source ListDrives 1.10 Return a string containing all drive letters in use 2011-04-06  
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source ListNICs 1.00 List physical network adapters 2011-11-01  
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source ListPrinters 1.10 List all available local printers 2011-04-06  
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source NumLock 1.00 Read or set NumLock key state 2011-04-04  
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source Paste 1.01 Read and display text from clipboard 2011-06-25  
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source 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 floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source PingSite 1.21 Check if a website is up and running 2011-10-18  
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source Printing 2.25 Pause or resume printing, or flush all queued printjobs on the specified printer(s), or list all printers, their status and number of printjobs 2011-04-01 Requires PrinterInfo.cs by Bas van der Woude
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source ScrollLock 1.00 Read or set ScrollLock key state 2011-04-04  
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source StringHash 1.01 Return the MD5 or SHA* hash value for the specified string 2010-07-29  
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source TranslateCulture 1.00 List translations for weekdays and/or month names for the specified cultures (languages) 2011-05-18  
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source WaitASecond 1.00 A 900..1100 milliseconds random time delay 2011-05-11  
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source WANIP 1.02 Get the computer's WAN IP address 2011-06-27  
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source WGetLite 1.00 Get web content (text only) 2011-04-14  

 


page last uploaded: 23 November 2011, 19:49