System.Diagnostics.Process.Start操作文件和文件夹(Unity3D)
2015-03-19 15:54
447 查看
最近在学习U3D,会写一些脚本工具,操作文件。
比如在unity中打开文本:
var logPath = Application.persistentDataPath+"/log";
var fileName = new DirectoryInfo(logPath).GetFiles().OrderBy(t=>t.LastWriteTime).Last().FullName;//取到文本路径
System.Diagnostics.Process.Start(fileName);//打开文本
也是可以打开网址System.Diagnostics.Process.Start(http://baidu.com);
比如在unity中打开文件夹
var logPath = Application.persistentDataPath + "/log";
System.Diagnostics.Process.Start("explorer.exe",logPath.Replace('/','\\'));//打开文件夹
比如在unity中打开文本:
var logPath = Application.persistentDataPath+"/log";
var fileName = new DirectoryInfo(logPath).GetFiles().OrderBy(t=>t.LastWriteTime).Last().FullName;//取到文本路径
System.Diagnostics.Process.Start(fileName);//打开文本
也是可以打开网址System.Diagnostics.Process.Start(http://baidu.com);
比如在unity中打开文件夹
var logPath = Application.persistentDataPath + "/log";
System.Diagnostics.Process.Start("explorer.exe",logPath.Replace('/','\\'));//打开文件夹
相关文章推荐
- c#调用exe文件:System.Diagnostics.Process.Start()的使用
- 使用System.Diagnostics.Process.Start()打开指定网址、文件、程序
- C#- System.Diagnostics.Process.Start的妙用
- System.Diagnostics.Process.Start("explorer.exe", path) 不完善之处
- 鼠标双击打开exe程序和System.Diagnostics.Process.Start(@"c:\xxx.exe")打开exe程序有什么区别?
- System.Diagnostics.Process.Start的妙用
- System.Diagnostics.Process.Start的妙用
- System.Diagnostics.Process.Start的用法(C#)
- System.Diagnostics.Process.Start()用法详解
- C# 之 System.Diagnostics.Process.Start的妙用
- System.Diagnostics.Process.Start(Info)
- System.Diagnostics.Process.Start()的使用
- 【转载System.Diagnostics.Process.Start的妙用】
- System.Diagnostics.Process.Start("CACLS.EXE","D:\\A /E /T /G ASPNET:F");
- System.Diagnostics.Process.Start的妙用
- System.Diagnostics.Process.Start()
- System.Diagnostics.Process.Start(strFilePath)
- C# System.Diagnostics.Process.Start的妙用
- System.Diagnostics.Process.Start的妙用
- 不清楚System.Diagnostics.Process.Start(e.LinkText); 的含义