Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit Unit1;
- interface
- uses
- Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
- Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
- type
- TForm1 = class(TForm)
- Button1: TButton;
- Edit1: TEdit;
- procedure Button1Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form1: TForm1;
- implementation
- {$R *.dfm}
- procedure TForm1.Button1Click(Sender: TObject);
- var
- FileName, DownloadFolder: string;
- SearchRec: TSearchRec;
- Found: Boolean;
- begin
- FileName := Edit1.Text;
- DownloadFolder := GetEnvironmentVariable('USERPROFILE') + '\Downloads\';
- Found := FindFirst(DownloadFolder + FileName + '.*', faAnyFile, SearchRec) = 0;
- if Found then
- ShowMessage('O arquivo ' + FileName + ' foi encontrado na pasta de downloads.')
- else
- ShowMessage('O arquivo ' + FileName + ' não foi encontrado na pasta de downloads.');
- FindClose(SearchRec);
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement