티스토리 툴바


 
var
  selectedFile   : string;
  drive          : char;
  path, fileName : string;

begin
  // Ask the user to select a file
  if PromptForFileName(selectedFile)
  then
  begin
    // Display this full file/path value
    ShowMessage('Selected file = '+selectedFile);

    // Split this full file/path value into its constituent parts
    ProcessPath(selectedFile, drive, path, fileName);
    ShowMessage('drive = '+drive);
    ShowMessage('path = '+path);
    ShowMessage('fileName = '+fileName);
  end;
end;

Result: 

{ The user selects C:\Files\data.txt and hits OK }
   
   Selected file = C:\Files\data.txt
   drive = C
   path = \Files
   filename = data.txt

댓글을 남겨주세요

Name *

Password *

Link (Your Homepage or Blog)

Comment

Secret

1 2 3 4 5 ... 11