如何找Path 的問題 |
尚未結案
|
Dark852
一般會員 發表:14 回覆:19 積分:6 註冊:2004-09-25 發送簡訊給我 |
|
speedup
資深會員 發表:19 回覆:259 積分:280 註冊:2003-07-04 發送簡訊給我 |
引言: 請問如果 detect 到那條path 是否存在呢 如 defaultPath := C:/Program Files/Test/Test.ini IF defaultPath Not Find defaultPath := D:/Program Files/Test/Test.ini看你的需求應該用FileExist defaultPath := 'C:/Program Files/Test/Test.ini'; IF Not FileExists(defaultPath) then defaultPath := D:/Program Files/Test/Test.ini;至於偵測路徑在不在的指令是DirectoryExists uses FileCtrl; procedure TForm1.Button1Click(Sender: TObject); begin if not DirectoryExists('c:\temp') then if not CreateDir('C:\temp') then raise Exception.Create('Cannot create c:\temp'); end;混心雜欲 棄修身~唉
------
唉~ |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |