Handle the file extention using the Path class

take a look http://dotnetuniver.blogspot.com/
Next Recommended Reading Handle Windows Long Paths Using C#