Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TForm1.Button2Click(Sender: TObject);
- var
- Arquivo: TMemoryStream;
- ArquivoString: string;
- begin
- if FileExists(Edit1.Text) then begin
- Arquivo := TMemoryStream.Create;
- Arquivo.LoadFromFile(Edit1.Text);
- ArquivoString := MemoryStreamToString(Arquivo);
- ArquivoString := Crypt(ArquivoString, Edit2.Text);
- Arquivo.Free;
- Arquivo := TMemoryStream.Create;
- Arquivo.WriteBuffer(Pointer(ArquivoString)^, Length(ArquivoString));
- if SaveDialog1.Execute then begin
- Arquivo.SaveToFile(SaveDialog1.FileName);
- Application.MessageBox('Saved successfully!', 'Warning', 64);
- end;
- Arquivo.Free;
- ArquivoString := '';
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement