procedure TForm1.splitpath(const FileName: string; var Adrive, ADir, AFileName ,Aext :string);
var
I,j,K: Integer;
begin
I := LastDelimiter( DriveDelim, FileName);
function ExtractFileDrive(const FileName: string): string;
function ExtractFilePath(const FileName: string): string;
function ExtractFileName(const FileName: string): string;
function ExtractFileExt(const FileName: string): string;
procedure TForm1.splitpath(const FileName: string; var Adrive, ADir, AFileName ,Aext :string);
var
I,j,K: Integer;
begin
I := LastDelimiter( DriveDelim, FileName);
J := LastDelimiter('.' + PathDelim + DriveDelim, FileName);
K := LastDelimiter( PathDelim + DriveDelim, FileName);
Adrive := Copy(FileName, 1, I);
ADir :=copy(FileName, i+2, K-i-1);
AFileName:= copy(FileName,K+1,J-K-1);
if (J > 0) and (FileName[J] = '.') then
Aext := Copy(FileName, J+1, MaxInt)
else
Aext := '';
end;
대충 만들어 봤습니다만...^^