c rar解壓大小 C 壓縮 解壓縮

2021-10-13 08:43:40 字數 1059 閱讀 2384

1 ///

2 ///壓縮檔案 fnamearry 為客戶端傳回來的檔案列表:檔名陣列,壓縮包的名稱strzipname3 ///

4 /// 檔名陣列

5 /// 壓縮包的名稱

6 public void zipfile(string fnamearry stringstrzipname)7 19 }20 u.finish(); //結束壓縮

21 u.close();22 }23 }24

30 //新增壓縮專案:p 為需壓縮的檔案或資料夾; u 為現有的源zipoutputstream; out j為已新增「zipentry」的「zipoutputstream」

31 public void addzipentry(string p zipoutputstream u outzipoutputstream j)32 49

51 //***************以上內容是修訂後新增的***************

56 foreach (directoryinfo tem in di.getdirectories()) //獲取子目錄

57 63 foreach (fileinfo temp in di.getfiles()) //獲取此目錄的檔案

64 68 }69 else if (file.exists(s)) //檔案的處理

70 80 j = u; //返回已新增資料的「zipoutputstream」

81 }82

90 ///

91 ///解壓92 ///

93 /// 檔名引數列表

94 public void unzipfile(string fnamearry) //解壓縮

95 119 if (!zp.isdirectory && zp.crc != 00000000l) //此「zipentry」不是「標記檔案」

120 131 else

132 135 }136 s.close();137 }138 goto a; //進入下乙個「zipentry」

139 }140 f.close();141 i2++;142 }143 }144 }

c rar解壓大小 C 解壓 壓縮RAR檔案

using system using system.collections.generic using system.text using system.io using microsoft.win32 using system.diagnostics namespace uni.unicustom...

c rar解壓大小 C 解壓 壓縮RAR檔案

using system using system.collections.generic using system.text using system.io using microsoft.win32 using system.diagnostics public class winrarhelp...

壓縮解壓縮

壓縮 壓縮後的檔名 包含物理路徑 待壓縮的資料夾 包含物理路徑 public static void packfiles string filename,string directory catch exception 解壓縮 待解壓檔名 包含物理路徑 解壓到哪個目錄中 包含物理路徑 public ...