C#获取路径中最后一个文件夹的名字
2021-07-01 01:09
标签:name static filename ons adk code u3d ace 文件 打印结果: C#获取路径中最后一个文件夹的名字 标签:name static filename ons adk code u3d ace 文件 原文地址:https://www.cnblogs.com/luguoshuai/p/9963200.html 1 using System;
2 using System.IO;
3
4 namespace ConsoleApplication1
5 {
6 class Program
7 {
8 static void Main(string[] args)
9 {
10 string path1 = @"E:\uniuProject5.6.2\art\UnityArt(u3d5.6.2)\Assets\Cloth\FBX\Character\Models";
11 string path2 = @"E:\uniuProject5.6.2\art\UnityArt(u3d5.6.2)\Assets\Cloth\FBX";
12 string path3 = @"E:\uniuProject5.6.2\art\UnityArt(u3d5.6.2)";
13 string path4 = @"E:\uniuProject5.6.2\art\UnityArt(u3d5.6)lklk";
14
15 Console.WriteLine(Path.GetFileNameWithoutExtension(path1));
16 Console.WriteLine(Path.GetFileNameWithoutExtension(path2));
17 Console.WriteLine(Path.GetFileNameWithoutExtension(path3));
18 Console.WriteLine(Path.GetFileNameWithoutExtension(path4));
19
20 Console.ReadKey();
21 }
22 }
23 }
上一篇:C# WinForm窗体及其控件自适应各种屏幕分辨率
下一篇:C# 类型转换