OK I have it now. It isn't exactly bullet-proof, but it works great and will at least get you started.
Now, remember, I wrote this in an hour so don't be too critical :P
Also you might have problems with the References since I am using the enterprise edition of Visual Basic and I don't recall changing it's default project's references. if so you can probably simply ignore them. I don't know what your project is that needs this but good luck!