how to make a visual basic program to record a 2 pin connection on a serial port?

baseballman999 asked: I run a retail store and i would like to know how many people come into my store by counting number of door openings. Using a magnet switch on the door and running it to a laptops serial pins and writing a program to record it all. Any help would [...]