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:
string strType=Path.GetExtension(filename);
As concerns you concrete problem , please look at this
MSDN