码迷,mamicode.com
首页 > 编程语言 > 详细

unity 如何打开本地文件夹,并选中文件

时间:2019-10-14 14:15:45      阅读:767      评论:0      收藏:0      [点我收藏+]

标签:direct   log   public   for   start   open   deb   exe   exist   

 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     }

 

unity 如何打开本地文件夹,并选中文件

标签:direct   log   public   for   start   open   deb   exe   exist   

原文地址:https://www.cnblogs.com/AaronBlogs/p/11671145.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!