游子日月长

笑渐不闻声渐悄,多情却被无情恼!

导航

Delphi 创建一个url网址快捷方式代码

procedure CreateURLShortcut(const ShortcutFile, URL: string);
var
  F: TextFile;  // text file
begin
  {$I+} // ensure file i/o raises exception on error
  // Open new file for writing (overwrites any existing file)
  AssignFile(F, ShortcutFile);
  Rewrite(F);
  try
    // Write file contents: this is simplest basic format of shortcut file
    WriteLn(F, '[InternetShortcut]');
    WriteLn(F, 'URL=', URL);
  finally
    // Close file
    CloseFile(F);
  end;
end;

 

posted on 2017-01-12 10:09  游子日月长  阅读(217)  评论(0编辑  收藏  举报