簡易的輸入字串 然後判斷為檔案還是資料夾

 

procedure TForm2.Button1Click(Sender: TObject);
var s:string;
begin
  if FileGetAttr(Edit1.Text) = faDirectory then
    s:='Y'
  else
    s:='N';
  ShowMessage('Dir > '+S);
  if FileExists(Edit1.Text)then
    s:='Y'
  else
    s:='N';
  ShowMessage('file > '+S);
end;

文章標籤
全站熱搜
創作者介紹
創作者 抓狂小白 的頭像
抓狂小白

抓狂小白的程式筆記

抓狂小白 發表在 痞客邦 留言(0) 人氣(54)