How To: Reading and Writing Text Files

Introduction Text files provide a common denominator format where both people and programs can read and understand. The .NET Framework includes convenience classes that make reading and writing text files very easy. The following sequence outlines the basic steps necessary to work with text files: Open the file Read/Write to the file Close the file … Continue reading “How To: Reading and Writing Text Files”

Event Handling in C#

No GUI application is complete without enabling actions. Even though arranging components is a significant issue, applying actions is also equally important. These actions are what instructs the program to act when something happens. For example, Mouse clicks, Keyboard presses, etc. Before beginning our discussion let’s review how different API’s handle events. Microsoft Foundation Classes … Continue reading “Event Handling in C#”

How To: Starting Processes From C#

Introduction A C# program can launch another program using the Process class. The Process class is part of the System.Diagnostics namespace. You start another program by instantiating a Process object, setting members of it’s StartInfo property, and invoking it’s Start() method. Listing 1 shows how to start a process from C#. Listing 1: Starting a … Continue reading “How To: Starting Processes From C#”

How To: Fetching Web Pages with HTTP

Introduction HTTP is the primary transport mechanism for communicating with resources over the World-Wide-Web. A developer will often want to obtain web pages for different reasons to include: search engine page caching, obtaining info on a particular page, or even implementing browser-like capabilities. To help with this task, the .NET Framework includes classes that make … Continue reading “How To: Fetching Web Pages with HTTP”