标签:des style blog class code java
public bool UnRAR(string destPath, string rarfilePath) { try { // destPath = @"E:\youxiaodi\temp"; //目标位置 // rarfilePath = @"E:\youxiaodi\temp\gif.rar"; //被解压文件 //组合出需要shell的完整格式 string shellArguments = string.Format("x -o+ \"{0}\" \"{1}\\\"", rarfilePath, destPath); //用Process调用 using (Process unrar = new Process()) { unrar.StartInfo.FileName = @"C:\Program Files\WinRAR\UnRAR.exe"; unrar.StartInfo.Arguments = shellArguments; //隐藏rar本身的窗口 unrar.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; unrar.Start(); //等待解压完成 unrar.WaitForExit(); unrar.Close(); } } catch (Exception ex) { return false; } return true; }
标签:des style blog class code java
原文地址:http://www.cnblogs.com/pigddyou/p/3714157.html