码迷,mamicode.com
首页 > 其他好文 > 详细

U3D调用7z解压文件

时间:2014-06-28 10:39:29      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   文件   os   art   

using UnityEngine;
using System;
using System.IO;
using System.Diagnostics;

public class Test : MonoBehaviour
{
    //7z程序的程序目录
    private string _7zExeUrl ;

    void Start()
    {
        _7zExeUrl = Application.dataPath + "/StreamingAssets/7z.exe";
        DecompressFileToDirectory(Application.dataPath + "/StreamingAssets/test.zip", Application.dataPath + "/StreamingAssets/");
    }

    public void DecompressFileToDirectory(string inFileath, string outFilePath)
    {
        try
        {
            Process process = new Process();
            string info = " x " + inFileath + " -o" + outFilePath + " -r ";
            ProcessStartInfo startInfo = new ProcessStartInfo(_7zExeUrl, info);
            process.StartInfo = startInfo;
            //隐藏DOS窗口  
            process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
            process.Start();
            process.WaitForExit();
            process.Close();
        }
        catch (Exception e)
        {
            UnityEngine.Debug.Log(e);
        }
        
    }
}

http://blog.csdn.net/awnuxcvbn/article/details/16886211

U3D调用7z解压文件,布布扣,bubuko.com

U3D调用7z解压文件

标签:style   blog   http   文件   os   art   

原文地址:http://www.cnblogs.com/softimagewht/p/3804150.html

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