unity 如何打開本地文件夾,並選中文件

 1 public static void OpenDirectory(string path, bool isFile = false)  2  {  3         if (string.IsNullOrEmpty(path)) return;  4         path = path.Replace("/", "\\");  5         if (isFile)  6  {  7             if (!File.Exists(path))  8  {  9                 Debug.LogError("No File: " + path); 10                 return; 11  } 12             path = string.Format("/Select, {0}", path); 13  } 14         else
15  { 16             if (!Directory.Exists(path)) 17  { 18                 Debug.LogError("No Directory: " + path); 19                 return; 20  } 21  } 22         //可能360不信任
23         System.Diagnostics.Process.Start("explorer.exe", path); 24     }
相關文章
相關標籤/搜索