全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:781
推到 Plurk!
推到 Facebook!

指定搜尋路徑的問題

答題得分者是:taishyang
onizuka5201314
一般會員


發表:15
回覆:7
積分:4
註冊:2005-03-17

發送簡訊給我
#1 引用回覆 回覆 發表時間:2005-05-27 00:01:12 IP:59.114.xxx.xxx 未訂閱
以下是參考allenchan大大的文章:    
void __fastcall TForm1::Button1Click(TObject *Sender)
{
     TSearchRec sr;
     String path = "c:\\test\\"; <---搜尋C槽下test的資料夾
     String mask = "*.bmp";         int iAttributes = 0
     iAttributes |= faArchive;
 //  iAttributes |= faReadOnly;
 //  iAttributes |= faHidden;
 //  iAttributes |= faSysFile;
 //  iAttributes |= faVolumeID;
 //  iAttributes |= faDirectory;
 //  iAttributes |= faAnyFile;       if (FindFirst(path   mask, iAttributes, sr) == 0)
   {
      do
      {
         if ((sr.Attr & iAttributes) == sr.Attr)
         {
            DeleteFile(path   sr.Name);
         }
      } while (FindNext(sr) == 0);
   FindClose(sr);
  }
}
但如果我要搜尋的資料夾的路徑不是放在c槽底下,我該如何改寫呢? (ex:c:\test\123\) 發表人 - onizuka5201314 於 2005/05/27 00:29:54
taishyang
站務副站長


發表:377
回覆:5490
積分:4563
註冊:2002-10-08

發送簡訊給我
#2 引用回覆 回覆 發表時間:2005-05-27 00:23:50 IP:218.168.xxx.xxx 未訂閱
您好:    PO程式碼的方式請參考版規說明,煩請修改謝謝您的配合 > <>< face="Verdana, Arial, Helvetica">引言: 但如果我要搜尋的資料夾的路徑不是放在c槽底下,我該如何改寫呢? (ex:c:\test\123\)
String path = "c:\\test\\"; 
改成
String path = "c:\\test\\123\\"; 
系統時間:2024-04-28 0:20:51
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!