string strFilePaht="文件路径"; Path.GetFileNameWithoutExtension(strFilePath); 获取后缀名 Path.GetFileName(strFilePath);