Here is my code in VB6. See if you can convert it in C#.