Hi, firts of all lets do some improvements.
What could be if a file name contains more than 1 dot ?)
I think it would be an exceptional state!
SO,strType can be resolved with help of Path class from System.IO namespace:
As concerns you concrete problem , please look at this MSDN