東京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”)


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

