Handle the file extention using the Path class

take a look http://dotnetuniver.blogspot.com/
Next Recommended Reading
File Handling Concept In C#