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     }

 

文章来自:https://www.cnblogs.com/AaronBlogs/p/11671145.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3