Uipath获取文件名,路径,扩展名等操作
东京IT青年前线
Uipath获取文件名,路径,扩展名等操作
使用Assign Activity,声明一个字符串变量为str

获取文件路径代码
System.IO.Path.GetDirectoryName(“C:\Users\Administrator\Desktop\备课\二回目\css基础.pptx”)


运行:

获取文件扩展名代码
System.IO.Path.GetExtension(“C:\Users\Administrator\Desktop\备课\二回目\css基础.pptx”)

运行结果

获取文件名:
System.IO.Path.GetFileName(“C:\Users\Administrator\Desktop\备课\二回目\css基础.pptx”)


获取文件名,不带扩展名
System.IO.Path.GetFileNameWithoutExtension(“C:\Users\Administrator\Desktop\备课\二回目\css基础.pptx”)


获取文件名所在的根目录
System.IO.Path.GetPathRoot(“C:\Users\Administrator\Desktop\备课\二回目\css基础.pptx”)


----------------------------------------------------------------------------------

浙公网安备 33010602011771号