乙個壓縮解壓縮檔案的dll的宣告說明

2021-09-30 02:52:52 字數 2201 閱讀 8658

?

.net中函式宣告:

public

static

extern

int myzip_addfile(string srcfile,string zipfile);

public

static

extern

int myzip_adddirectory(string srcpath,string zipfile);

public

static

extern

int myzip_extractfileall(string zipfile,string pathname);

public

static

extern

int myzip_extractfile(string zipfile,string srcname,string dstname); ?

1.(壓縮檔案)

function myzip_addfile(srcfile,zipfile:pchar):integer;stdcall;

功能: 將檔案srcfile新增到壓縮文件zipfile

引數: srcfile?????? 待壓縮檔案(全路徑)

?????? zipfile?????? 目標檔案(全路徑)

返回: <0??????????? 失敗

?????? >0??????????? 成功

說明: 同名檔案將自動被替換(overwrite)

?2.(壓縮目錄)

function myzip_adddirectory(srcpath,zipfile:pchar):integer;stdcall;

功能: 將目錄srcpath裡的所有檔案(子目錄)新增到壓縮文件zipfile

引數: srcpath?????? 待壓縮目錄(全路徑)

?????? zipfile?????? 目標檔案(全路徑)

返回: <0??????????? 失敗

?????? >0??????????? 成功

說明: 同名檔案將自動被替換(overwrite)

?

1.(解壓縮包中所有檔案)

function myzip_extractfileall(zipfile,pathname:pchar):integer;stdcall;

功能: 將zipfile中包含的所有檔案解包到資料夾pathname

引數: zipfile?????? 壓縮檔案(全路徑)

?????? pathname????? 檔案輸出路徑(如果不存在,則自動建立該目錄)

返回: <0??????????? 失敗

?????? =0??????????? 壓縮檔案中未包含任何檔案

?????? >0?

??????????解包的檔案數量

說明: 同名檔案將自動被替換(overwrite)

?2.(解壓縮包中指定檔案)

function myzip_extractfile(zipfile,srcname,dstname:pchar):integer;stdcall;

功能: 從zipfile中將由srcname指定的檔案解包到由dstname指定的目標檔案

引數: zipfile?????? 壓縮檔案(全路徑)

?????? srcname?????? 需要解包的檔案(不包含路徑)

?????? dstname?????? 目標檔案(全路徑)

返回: <0??????????? 失敗

?????? =0??????????? 壓縮檔案中未包含srcname

?????? >0??????????? 成功

說明: 同名檔案將自動被替換(overwrite)

?1.(錯誤資訊)

function myzip_getlasterror(out msg : shortstring):integer;stdcall;

功能: 在壓縮/解壓的過程中,如有錯誤發生,可立即呼叫該函式獲取相關錯誤資訊,並由msg返回

引數: msg?????????? 用於返回相關錯誤資訊

返回: <0??????????? 失敗

?????? >0??????????? 成功

??

解壓縮檔案

public static fastzip fz new fastzip 壓縮檔案 壓縮檔案的路徑與名稱 被壓縮的檔案路徑 解壓密碼 null代表無密碼 public static string filetozip string zipfilepath,string filepath,string ...

解壓縮檔案

using system using system.collections.generic using system.linq using system.text using system.threading.tasks using system.io namespace commonhelper ...

php壓縮解壓縮檔案

注 需要安裝zip擴充套件 壓縮單個檔案 method zip file param string filename 檔名 return boolean true false function zip file string filename zip new ziparchive zipname b...