Autor Beitrag
breakdancer1111
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 148

Windows 7 Home Premium 64Bit
Delphi XE2 Starter
BeitragVerfasst: So 22.06.03 16:14 
Hallo!
Wie kann ich die Url aus
einer *.url Datei auslesen?
Tweafis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 647

WinXP + fbsd
Delphi 5 Prof
BeitragVerfasst: So 22.06.03 16:28 
Das musst per IniFile machen. Die sehen ja ungefähr so aus:

ausblenden Quelltext
1:
2:
3:
[InternetShortcut]
URL=http://www.microsoft.com/isapi/redir.dll?prd=ie&pver=6&ar=IStart
Modified=D027E4F36C5EC2015B


also per IniFile die Section InternetShortcut und den wert zu URL auslesen. Werde gleich gucken ob ich einen Quellcode dazu finde

// Edit: So:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
function GetUrlfromUrlFile(filename: string): string;
var
  IniFile: TIniFile;
begin
  IniFile := TIniFile.Create(filename);
  try
    result := IniFile.ReadString('InternetShortcut''Url''Error');
  finally
    Inifile.free;
  end;
end;


Das try finally kann man wahrscheinlich auch weglassen, aber schadet ja nix. Das Error muss du durch die Adresse ersetzen die zurückgegeben werden soll falls der eintrag nicht vorhanden ist.

_________________
.: Es wird der Tag kommen, an dem wir es nicht mehr ändern können :.
nagash369
Hält's aus hier
Beiträge: 11



BeitragVerfasst: So 22.06.03 17:06 
www.tipps.delphi-sou.../tut20010113-1.shtml

kann die site übrigens nur empfehlen, vor allem weil es hier im forum immer etwas länger dauert bis jemand antwortet :( , am besten vorher da gucken
breakdancer1111 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 148

Windows 7 Home Premium 64Bit
Delphi XE2 Starter
BeitragVerfasst: Mo 23.06.03 20:44 
Ok, danke!
Alerdings klappt die Lösung
von Delphi-Source nicht so
recht. :(