function ExtractFileName(const FileName: string): string; // 解出文件名 function ExtractFilePath(const FileName: string): string; // 解出文件路径
function ExtractFileName(const FileName: string): string; var P: Integer; begin P := Length(FileName); while (P > 0) and (FileName[P] <> '\') and (FileName[P] <> ':') do Dec(P); Result := Copy(FileName, P + 1, Length(FileName) - P); end;
function ExtractFilePath(const FileName: string): string; var P: Integer; begin P := Length(FileName); while (P > 0) and (FileName[P] <> '\') and (FileName[P] <> ':') do Dec(P); Result := Copy(FileName, 1, P); end;