Reading and Writing Text Files in C#

With all the DBMSs out there, text files are still widely used when developing applications. They are small, fast and do not require any library or application to be installed in the client machine. The …

Saving User and Application Settings in WinForms

Before the .NET Framework application settings were saved in INI files and the Windows Registry. But the .NET Framework introduced a much easier way using an XML file. The file has the name of the …

How to Download a Web Page in WinForms

Sometimes a desktop application might need to download a web page to be displayed to the user or screen scrapped.

Shutdown or Restart the Computer Using C#

The easiest way to shutdown, restart, or hibernate a computer programmatically using C# is to use the shutdown command-line tool that comes with Windows.

Multithreading in .NET With the BackgroundWorker

Sometimes a smart client application needs to do a lengthy operation that can slow down the performance of the whole application and make it unresponsive.

Minimize an Application to the System Tray

To be able to use the System Tray in Visual Studio, drag and drop the NotifyIcon control. The important properties to set are Text and Icon.

Programming for Multiple Screens in DotNET

This is a piece of code I used for an application that needed to be displayed in 2 screens setup as extended view. I used a simple calculation to know the selected screen's coordinates and …

Creating Your Own Travian Utilities

Travian the well known browser game has a downloadable file for developers in each of its servers that provides details of all the players of the server.

Using Microsoft Office's OCR Engine

The Microsoft Office Document Imaging library that is provided with Office 2003 and Office 2007, has Optical Character Recognition (OCR) that can extract text and layout from image files.

Retrieving Icons From Executables

I found this code somewhere on the web two years ago. It basically gets the large (32 x 32 pixels) and small (16 x 16 pixels) icons of an executable.