procedure WriteURL(FileName: TFileName;
URL:
string;
IconFile:
string = '
'; IconIndex: Integer = 1);
var
FStream: TFileStream;
Buffer:
string;
begin
FStream := TFileStream.Create(FileName, fmCreate
or fmShareExclusive);
Buffer := '
[DEFAULT]' + #$0D#$0A;
FStream.WriteBuffer(Pointer(Buffer)^, Length(Buffer));
Buffer := '
BASEURL=' +
URL + #$0D#$0A;
FStream.WriteBuffer(Pointer(Buffer)^, Length(Buffer));
Buffer := '
[InternetShortcut]' + #$0D#$0A;
FStream.WriteBuffer(Pointer(Buffer)^, Length(Buffer));
Buffer := '
URL=' +
URL + #$0D#$0A;
FStream.WriteBuffer(Pointer(Buffer)^, Length(Buffer));
if Trim(IconFile) <> '
'
then
begin
Buffer := '
IconFile=' + IconFile + #$0D#$0A;
FStream.WriteBuffer(Pointer(Buffer)^, Length(Buffer));
Buffer := '
IconIndex=' + IntToStr(IconIndex) + #$0D#$0A;
FStream.WriteBuffer(Pointer(Buffer)^, Length(Buffer));
end;
FStream.Free;
end;