Category Archives: system

Display a colored battery status in C#

This is a minor update to the example Display battery status in a friendly way in C#. That example periodically checks the battery’s charge. It then draws textual and graphical indicators of the charge and plugged/unplugged status. That example was … Continue reading

Posted in drawing, graphics, system | Tagged , , , , , , , , , , | Comments Off on Display a colored battery status in C#

Use command line arguments to open files in C#

Whenever a C# program starts, it receives command line arguments. You can use those arguments to let your program open files that are associated with the program. For example, when you double-click a .doc or .docx file, Microsoft Word opens … Continue reading

Posted in serialization, system | Tagged , , , , , , , | Comments Off on Use command line arguments to open files in C#

Build a Windows process tree in C#

A process tree is a tree that shows the processes running on the computer arranged hierarchically so you can see which processes started other processes. My first attempts at this used techniques that I found scattered around the internet. Unfortunately … Continue reading

Posted in algorithms, system | Tagged , , , , , , , , , | 5 Comments

Delete files from multiple folders quickly and easily in C#

The example Delete files quickly and easily in C# lets you make a list of files matching a pattern, check the files that you want deleted, and then delete them all quickly. Reader Uldis posted a comment asking how to … Continue reading

Posted in files, system | Tagged , , , , , , , , , , | Comments Off on Delete files from multiple folders quickly and easily in C#

Quick notes on the recent Windows update

Recently my computer decided that it needed to perform a big Windows update. I can usually tell when that’s about to happen because performance is terrible for no obvious reason. BTW, if you wonder whether an update is impacting performance, … Continue reading

Posted in system | Tagged , , , , , , , | 2 Comments

Get information about Windows shortcuts in C#

This post explains how to get information about Windows shortcuts. The post has two parts. The first explains how to get the information. The second explains how to create shortcuts. Getting Shortcut Information This example uses the following GetShortcutInfo method … Continue reading

Posted in system | Tagged , , , , , , , , , | 6 Comments

Merge directories in C#

This example lets you merge directories. Once upon a time, if you used Windows Explorer to move a file from one directory to another and the destination directory already contained a file with that name, you had the option of … Continue reading

Posted in directories, files, system, tools | Tagged , , , , , , , , , , , , , , | Comments Off on Merge directories in C#

Find duplicate files in C#, Part 4 of 4

The last three posts described an application that searches for duplicate files and removes them. The program seems to work fairly well, at least for small test directories. When I tried it on a directory containing around 8,000 files, however, … Continue reading

Posted in algorithms, cryptography, files, system, tools | Tagged , , , , , , , , , , , , , , , , , , | 1 Comment

Find duplicate files in C#, Part 3 of 4

The last two posts described an application that searches for duplicate files and removes them. This post explains how the program removes the files when you click the Delete Selected button. When you click the button, the following code executes. … Continue reading

Posted in algorithms, cryptography, files, system, tools | Tagged , , , , , , , , , , , , , , , , , , | Comments Off on Find duplicate files in C#, Part 3 of 4

Find duplicate files in C#, Part 2 of 4

The previous post Find duplicate files in C#, Part 1 of 4 explained how the example uses a LINQ query to select files grouped by hash code. This post explains how the program displays the files’ contents and how the … Continue reading

Posted in algorithms, cryptography, files, system, tools | Tagged , , , , , , , , , , , , , , , , , , | 1 Comment