Delphi determines whether the file is a URL shortcut

From , 5 Years ago, written in Delphi (Object Pascal), viewed 225 times.
URL https://pastebin.vip/view/220787ad
  1. function IsURLShortcut(const ShortcutFile: string): Boolean;
  2. var
  3.   Ini: IniFiles.TIniFile; // used to read ini files
  4. begin
  5.   // File must exist
  6.   if SysUtils.FileExists(ShortcutFile) then
  7.   begin
  8.     // Open ini file and check value exists
  9.     Ini := IniFiles.TIniFile.Create(ShortcutFile);
  10.     try
  11.       Result := Ini.SectionExists('InternetShortcut')
  12.         and Ini.ValueExists('InternetShortcut', 'URL')
  13.         and (Ini.ReadString('InternetShortcut', 'URL', '') <> '');
  14.     finally
  15.       Ini.Free;
  16.     end;
  17.   end
  18.   else
  19.     Result := False;
  20. end;
  21. //delphi/2218

Reply to "Delphi determines whether the file is a URL shortcut"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website