C#获取文件名和扩展名(后缀名)

C#获取文件名和扩展名(后缀名)

2023年7月3日发(作者:)

C#获取⽂件名和扩展名(后缀名)string fullPath = @"d:";string filename = eName(fullPath);//返回带扩展名的⽂件名 ""string extension = ension(fullPath);//扩展名 ".aspx"string fileNameWithoutExtension = eNameWithoutExtension(fullPath);// 没有扩展名的⽂件名 "default"string dirPath = ectoryName(filePath) //返回⽂件所在⽬录 "d:test"string fullPath1 = e(@"d:test", "") //返回 "d:"string fullPath2 = lPath("");//返回指定路径字符串的绝对路径string Path = @"d:testdefaultproject"; //⽬录string name = eName( Path); //返回⽬录名 “project”使⽤字符串截取:string filePath= @"d:";string filename = ing( dexOf(@"") + 1); //截取⽂件名 ""

发布者:admin,转转请注明出处:http://www.yc00.com/news/1688380604a129363.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信