unity技術 資源管理器explorer使用
簡介在window上可以使用explorer來啟動資源管理器,來檢視相應的內容。在unity中編寫編輯器時,有時候會希望處理完成後開啟對應的檔案所在的位置,以方便給使用者提示生成的檔案位置或者檢視生成結果,本文將介紹一下explorer的命令列引數及如何在c#中使用
對於explorer大家應該是經常用到,如果覺得陌生,可以開啟"任務管理器"找到explorer,然後結束掉此程序,看看會出現什麼情況
資源管理器explorer使用(
explorer命令列引數
命令格式:
explorer /n[[,/root],[path]][[,/select],[path filename]]
引數說明:
/n 表示以「我的電腦」方式開啟乙個新的視窗,通常開啟的是windows安裝分割槽的根目錄
/e 表示以「資源管理器」方式開啟乙個新的視窗,通常開啟的也是windows安裝分割槽的根目錄
/root,[path] 表示開啟指定的資料夾,/root表示只顯示指定資料夾下面的檔案(夾),不顯示其它磁碟分割槽和資料夾;[path]表示指定的路徑
如果不加/root引數,而只用[path]引數,則可以顯示其它磁碟分割槽和資料夾中的內容。另外,[path]還可以指定網路共享資料夾。
/select,[path filename]表示開啟指定的資料夾並且選中指定的檔案,[path filename]表示指定的路徑和檔名.
如果不加/select引數,則系統會用相應的關聯程式開啟該檔案。如果[path filename]不跟檔名就會開啟該資料夾的上級目錄並選中該資料夾。
示例:explorer /n
此命令使用預設設定開啟乙個資源管理器視窗。顯示的內容通常是安裝 windows 的驅動器的根目錄。
explorer /e
此命令使用預設檢視啟動 windows 資源管理器。
explorer /e,c:windows
此命令使用預設檢視啟動 windows 資源管理器,並把焦點定位在 c:windows。
explorer /root, c:windowscursors
此命令啟動 windows 資源管理器後焦點定位在 c:windowscursors folder。此示例使用 c:windowscursors 作為 windows 資源管理器的"根"目錄。
備註:請注意命令中"/root"引數後面的逗號。
explorer /select, c:windowscursorsbanana.ani
此命令啟動 windows 資源管理器後選定"c:windowscursorsbanana.ani"檔案。
備註:請注意命令中"/select"引數後面的逗號。
unity中使用c#中呼叫explorer
在c#指令碼中可以使用process來呼叫explorer來開啟需要的目錄或者選中需要的檔案。
呼叫explorer在win上開啟目錄
explorerutil.openexplorerfolder(@"c:windows")
呼叫explorer在win上開啟目錄並選中希望選中的檔案
explorerutil.openexplorerfile(@"c:windowssystem32calc.exe")
注意事項:
對於目錄或者檔案路徑需要特別注意的,只能使用""而不能使用"/"
public static class explorerutil
}更多unity2018的功能介紹請到paws3d爪爪學院查詢。
Unity技術 資源管理器explorer使用
在window上可以使用explorer來啟動資源管理器,來檢視相應的內容。在unity中編寫編輯器時,有時候會希望處理完成後開啟對應的檔案所在的位置,以方便給使用者提示生成的檔案位置或者檢視生成結果,本文將介紹一下explorer的命令列引數及如何在c 中使用 對於explorer大家應該是經常用...
資源管理器
using system using system.collections.generic using system.linq using system.text using system.threading.tasks namespace day 09 小型資源管理器 檔案長度 public st...
簡單資源管理器
下面共享乙個我自己的資源管理器,很簡單的,看起來也明白,主要是我是新手,不想寫的太複雜,自己專案使用的好用,便是最好的。using unityengine using system.collections using system.collections.generic using system p...