Category: WinForms

Dictionaries of HTML Codes

February 11, 2009 | By | Add a Comment

I wrote this class to help me do some screen scraping programs. It has two Dictionary objects. One contains the HTML codes and their text equivalents and the other contains the numeric HTML codes and their text equivalents.

Continue Reading

Capturing Outlook 2007′s New Mail and Reminder Events

February 3, 2009 | By | 2 Comments

Visual Studio 2008′s Outlook Add-in projects allows you to create add-ins that can customize almost any feature of Ms Outlook. Two useful events that can be captured are ReminderFire and NewMailEx. The first occurs before a reminder of a calendar item is executed. And the second occurs when a new email is received in the [...]

Continue Reading

Reading Excel 2003 and 2007 Files Using OLEDB

January 30, 2009 | By | 39 Comments

One of the feature of the application I’m working on these days is allowing the user to import data from Excel 2003 and 2007 files. After some research I found out that OLEDB is the only way to read both Excel formats without any problems.

Continue Reading

Lock, Sleep or Hibernate Windows using C#

January 28, 2009 | By | 4 Comments

I don’t think there is a Windows developer who has not done this with his or her favorite programming language. So here is the C# version. Putting Windows in Sleep or Hibernate mode can be done with one line of code using the Windows.Forms.Application object’s SetSuspendState method, and locking can be done using Win32′s LockWorkStation [...]

Continue Reading

Reading and Writing Text Files in C#

January 24, 2009 | By | Add a Comment

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 System.IO.StreamReader and System.IO.StreamWriter are used to read and write text files to disk.

Continue Reading

How to Download a Web Page in WinForms

January 18, 2009 | By | Add a Comment

Sometimes a desktop application might need to download a web page to be displayed to the user or screen scrapped. I did this in my MoviePlay application to get the IMDb (The Internet Movie Database) page of the movie.

Continue Reading