unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
SD: TSaveDialog;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure ESF(Sender: TObject);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.ESF(Sender: TObject);
var
SL : TStringList;
begin
SD.DefaultExt := '*.url';
SD.Filter := 'Internet Shorcut|*.url';
if not SD.Execute then
exit;
SL := TStringList.Create;
SL.Add('[InternetShortcut]');
SL.Add('URL='+Edit1.Text);
SL.SaveToFile(SD.FileName);
SL.Free;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Edit1.Text := 'http://amateur-guide.blogspot.com';
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ESF(Self);
end;
end.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
SD: TSaveDialog;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure ESF(Sender: TObject);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.ESF(Sender: TObject);
var
SL : TStringList;
begin
SD.DefaultExt := '*.url';
SD.Filter := 'Internet Shorcut|*.url';
if not SD.Execute then
exit;
SL := TStringList.Create;
SL.Add('[InternetShortcut]');
SL.Add('URL='+Edit1.Text);
SL.SaveToFile(SD.FileName);
SL.Free;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Edit1.Text := 'http://amateur-guide.blogspot.com';
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ESF(Self);
end;
end.
No comments:
Post a Comment