1 (edited by manixs2013 2019-10-11 07:11:48)

Topic: ZIP

Hello MVD

Is there a way to read a zip file then extract the files and read by MVD?

Anybody with kindhearted to help me... please... i need a sample?

Thanks!

Re: ZIP

Hello.


ExtractZipFile('d:\filename.zip', 'd:\foldername');
Dmitry.

Re: ZIP

Ok Drivesoft.. Thanks!

Re: ZIP

manixs2013 wrote:

read a zip file

Вроди как должно быть так

procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
var
OpenDialog: TOpenDialog;
ArchiveFile: String;
zip:TZipFile;
begin
  zip:=TZipFile.Create;
  OpenDialog := TOpenDialog.Create(Form1);
  if OpenDialog.Execute then
     begin
        Form1.Edit1.Text:=OpenDialog.FileName;
        try
            zip.Open(OpenDialog.FileName,zmRead);
            for ArchiveFile in zip.FileNames do
            Form1.Memo1.Lines.Add(ArchiveFile);
            zip.Close;
        finally
        zip.Free;
       end;
     end;
end;

но  for ArchiveFile in zip.FileNames do   ошибка

Re: ZIP

sibprogsistem wrote:
manixs2013 wrote:

read a zip file

Вроди как должно быть так

procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
var
OpenDialog: TOpenDialog;
ArchiveFile: String;
zip:TZipFile;
begin
  zip:=TZipFile.Create;
  OpenDialog := TOpenDialog.Create(Form1);
  if OpenDialog.Execute then
     begin
        Form1.Edit1.Text:=OpenDialog.FileName;
        try
            zip.Open(OpenDialog.FileName,zmRead);
            for ArchiveFile in zip.FileNames do
            Form1.Memo1.Lines.Add(ArchiveFile);
            zip.Close;
        finally
        zip.Free;
       end;
     end;
end;

но  for ArchiveFile in zip.FileNames do   ошибка


In may project I used the random images... Now, I want the images packed on zip file..
How to call the images on the random script

*** this is the random script********
             main1.imageBG.Visible:=true;
             vrandompicture := 'Resources\rImages\' + inttostr(random(RandomImages)) + '.png';
             main1.imageBG.picture.loadfromfile(vrandompicture);
             main1.pathSecret.Text := vrandompicture;

Re: ZIP

DriveSoft wrote:

Hello.


ExtractZipFile('d:\filename.zip', 'd:\foldername');

In may project I used the random images... Now, I want the images packed on zip file..
How to call the images on the random script

*** this is the random script********
             main1.imageBG.Visible:=true;
             vrandompicture := 'Resources\rImages\' + inttostr(random(RandomImages)) + '.png';
             main1.imageBG.picture.loadfromfile(vrandompicture);
             main1.pathSecret.Text := vrandompicture;