Path类 操作文件类的实例

雨下整夜 10 0 PDF 2021-02-24 02:02:59

// Path类 IO命名空间 静态类 不能创建对象类名. string str =@E:\C#程序设计基础入门教程\(第十一天)\122\22\nee.txt; ////int index=str.LastIndexOf (\\)//最后一出现的位置 ////str =str.Substring (index +1);//拿到最后一个文件 ////Console.WriteLine(str); Console.WriteLine(Path.GetFileName(str)); //获得文件名包括扩展名 Console.WriteLine(Pat

用户评论
请输入评论内容
评分:
暂无评论