Autor Beitrag
JRegier
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Di 04.10.05 13:40 
Hi, wie extrahiere ich den Dateinamen aus einer URL?
Ich hatte mal vorher mit ExtractFileName gemacht es hat auch geklappt und
beim zweiten versuch nicht!
r4id3n
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 115

Win XP Home, Win XP Pro
D6 Prof, D7 Ent, K3 Ent
BeitragVerfasst: Di 04.10.05 14:03 
Vorher ein AnsiReplaceText und damit die / durch \ ersetzen, dann geht ExtractFileName wieder ;-)
JRegier Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Di 04.10.05 19:50 
Vielen Dank eure Hoheit! :wink:
Oder man schreibt ne eigene Funktion die das direkt mit den / Zeichen macht ohne diesem Umweg!
Klabautermann
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Veteran
Beiträge: 6366
Erhaltene Danke: 60

Windows 7, Ubuntu
Delphi 7 Prof.
BeitragVerfasst: Di 04.10.05 23:01 
Hi,

ich würde sagen die eigene Funktion ist der Umweg. Schließlich wurde das Rad ja schon erfunden.
Aber jeden das seine.

Gruß
Klabautermann
JRegier Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Mi 05.10.05 04:54 
user profile iconKlabautermann hat folgendes geschrieben:
Hi,

ich würde sagen die eigene Funktion ist der Umweg. Schließlich wurde das Rad ja schon erfunden.
Aber jeden das seine.

Gruß
Klabautermann


Nein aber bevor ich erst alle / Zeichen durch \ erstezen muß, und dann ExtractFileName
hat der Computer unnötige Arbeit zu leisten!

Ich kann doch einfach:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
for I := Length(URL) downto 1 
begin
  if(URL[I] = '/')then
  begin
  FileName := Copy(URL, I + 1, Length(URL) - I - 1);
  Break;  
  end;
end;


wäre schneller, Oder?