C#通过文件路径获取文件名小技巧
string fullPath = @"\WebSite1\Default.aspx";
string filename = System.IO.Path.GetFileName(fullPath);//得到文件名“Default.aspx”
string extension = System.IO.Path.GetExtension(fullPath);//得到扩展名“.aspx”
string fileNameWithoutExtension = System.IO.Path.GetFileNameWithoutExtension(fullPath);// 得到没有扩展名的文件名 “Default”
中国· 义乌
添加微信咨询
CopyRight©2019-2027 义乌仓颉网络科技有限公司 All Rights Reserved. 浙ICP备2025202763号