Mega Code Archive

 
Categories / Delphi / Files
 

Uzak yoldan dosya adının ayıklanması

function ExtractRemoteFilePath(const FileName: string): string; var I: Integer; Len: Integer; P: Integer; begin Result := ''; Len := Length(FileName); p := 0; for i := Len downto 1 do if FileName[i] = '/' then begin P := I; Break; end; if P = 0 then Result := FileName else Result := Copy(FileName, 1, P); end; // Kullanımı: Label1.Caption := ExtractRemoteFilePath('http://www.xxx.com/downloads/x.txt');