private static int findExtension (string path)
{
// method should return the index of the path extension
// start or -1 if no valid extension
if (path != null){
int iLastDot = path.LastIndexOf ('.');
int iLastSep = path.LastIndexOfAny ( PathSeparatorChars );
if (iLastDot > iLastSep)
return iLastDot;
}
return -1;
}