請問如何用Delphi來執行winrar的壓縮與解壓縮? |
尚未結案
|
tomking
一般會員 ![]() ![]() 發表:9 回覆:7 積分:3 註冊:2003-03-31 發送簡訊給我 |
我執行下段語法會有錯誤訊息,但依然會壓縮成功
procedure TForm1.Button1Click(Sender: TObject);
var
s1:pchar;
begin
StrPCopy(s1,'C:\Program Files\WinRar\Winrar.EXE a C:\test.rar C:\test.doc');
WinExec(s1,SW_NORMAL);
end; 錯誤訊息:
Project Project1.exe raised exception class EAccessViolation with message 'Access violation at address
0040368A in module 'Project1.exe'. Read of address 505C3A13'. Process stopped.Use Step or Run to continue. 另外要如何用參數來帶入壓縮來源檔"C:\test.doc" 發表人 - tomking 於 2004/06/28 11:38:17
|
huwk
資深會員 ![]() ![]() ![]() ![]() ![]() 發表:26 回覆:340 積分:323 註冊:2002-04-03 發送簡訊給我 |
1.請將宣告改成 s1: array[0..200] of Char;
2.另外要如何用參數來帶入壓縮來源檔"C:\test.doc" ? 你現在做的不就是這樣子嗎? PS第二項若是要解壓縮..請參考
Extract files and folder with full paths. The folder structure, saved in the archive, is completely restored. This is the command line equivalent of the archive management command Extract.
In a similar manner as command e this command can extract files both to the current folder and to a specified folder.
For example, command:
WinRAR x Fonts *.ttf
will extract *.ttf files from the archive Fonts to the current folder, but the command: WinRAR x Fonts *.ttf NewFontswill extract *.ttf files from the archive Fonts to the folder NewFonts You need to use the trailing backslash as in the example above for denoting the destination folder. 發表人 - huwk 於 2004/06/28 11:45:25
------
熊的學習 http://huwk.blogspot.com |
circusmonkey
一般會員 ![]() ![]() 發表:6 回覆:10 積分:8 註冊:2004-06-28 發送簡訊給我 |
|
conundrum
尊榮會員 ![]() ![]() ![]() ![]() ![]() ![]() 發表:893 回覆:1272 積分:643 註冊:2004-01-06 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |