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

 


using System;
using System.IO;

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

}

posted on 2008-10-24 17:03  王培  阅读(684)  评论(0编辑  收藏  举报

导航