public static void UnzipFile(string filePath) { try { FileInfo file = new FileInfo(filePath); if (file.Exists && file.Extension.ToLower() == ".ztlj") { string forderName = file.Name.Substring(0, file.Name.Length - 5); string forderPath = Path.Combine(file.Directory.FullName, forderName); if (Directory.Exists(forderPath)) { Directory.Delete(forderPath, true); } Directory.CreateDirectory(forderPath); UnZipFloClass unzip = new UnZipFloClass(); unzip.unZipFile(filePath, forderPath); System.Threading.Thread.Sleep(100); file.Delete(); } } catch (Exception ex) { FileManager.Common.LogHelper.WriteLog("Error", ex.Message + "\r\n" + ex.StackTrace); } }
private void UnzipFile(string filePath) { FileInfo file = new FileInfo(filePath); if (file.Exists && file.Extension.ToLower() == ".ztlj") { string forderName = file.Name.Substring(0, file.Name.Length - 5); string forderPath = Path.Combine(file.Directory.FullName, forderName); if (Directory.Exists(forderPath)) { Directory.Delete(forderPath, true); } Directory.CreateDirectory(forderPath); UnZipFloClass unzip = new UnZipFloClass(); unzip.unZipFile(filePath, forderPath); } }