[Delphi (Object Pascal)] Delphi 判断文件是否是url快捷方式 →→→→→进入此内容的聊天室

来自 , 2019-02-17, 写在 Delphi (Object Pascal), 查看 131 次.
URL http://www.code666.cn/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

回复 "Delphi 判断文件是否是url快捷方式"

这儿你可以回复上面这条便签

captcha