C#_获取文件路径中的文件名_扩展名


using System;
using System.IO;

class Test
{
string path = "d:asdfasdf.bmp";
string fileName = Path.GetFileName(path); //文件名
string ext = Path.GetExtension(path); //扩展名

}
原文地址:https://www.cnblogs.com/wangpei/p/1318924.html