線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:1763
推到 Plurk!
推到 Facebook!

看不懂Delphi if xx in xx , 請幫我翻譯成BCB.

答題得分者是:RaynorPao
Dip
一般會員


發表:6
回覆:4
積分:2
註冊:2004-04-19

發送簡訊給我
#1 引用回覆 回覆 發表時間:2004-09-13 15:53:36 IP:210.243.xxx.xxx 未訂閱
這是從 Disk Controls Readme及Demo截錄出來的. 請教教我,如何在BCB上存取 dcFileInfoAttributes. 萬分感謝! if xx in .. 傻眼中...    
    St := 'Attributes: ';
    if fiaArchive in dcFileInfo.FileAttributes then
     St := St   'Archive ';
    if fiaHidden in dcFileInfo.FileAttributes then
     St := St   'Hidden ';
    if fiaReadOnly in dcFileInfo.FileAttributes then
     St := St   'ReadOnly ';
    if fiaSystem in dcFileInfo.FileAttributes then
     St := St   'System '; 
Declaration    type      TdcFileInfoAttributes = set of (fiaArchive, fiaHidden, fiaReadOnly, fiaSystem, fiaDirectory, fiaTemporary, fiaCompressed, fiaOffline);    property FileAttributes: TdcFileInfoAttributes;    Description    The FileAttributes property determines and changes the attributes for the file specified in the FileName property.    Value        Meaning
 fiaArchive        The file is an archive file. Applications use this value to mark files for backup or removal;
 fiaHidden        The file is hidden. It is not included in an ordinary directory listing;
 fiaReadOnly        The file is read-only. Applications can read the file but cannot write to it or delete it;
 fiaSystem        The file is part of the operating system or is used exclusively by it;
 fiaDirectory        The file is a directory; 
發表人 - dip 於 2004/09/13 15:57:41
RaynorPao
版主


發表:139
回覆:3622
積分:7025
註冊:2002-08-12

發送簡訊給我
#2 引用回覆 回覆 發表時間:2004-09-13 16:13:18 IP:203.73.xxx.xxx 未訂閱
引言: 這是從 Disk Controls Readme及Demo截錄出來的. 請教教我,如何在BCB上存取 dcFileInfoAttributes. 萬分感謝! if xx in .. 傻眼中...
    St := 'Attributes: ';
    if fiaArchive in dcFileInfo.FileAttributes then
     St := St + 'Archive ';
    if fiaHidden in dcFileInfo.FileAttributes then
     St := St + 'Hidden ';
    if fiaReadOnly in dcFileInfo.FileAttributes then
     St := St + 'ReadOnly ';
    if fiaSystem in dcFileInfo.FileAttributes then
     St := St + 'System '; 
Declaration    type      TdcFileInfoAttributes = set of (fiaArchive, fiaHidden, fiaReadOnly, fiaSystem, fiaDirectory, fiaTemporary, fiaCompressed, fiaOffline);    property FileAttributes: TdcFileInfoAttributes;    Description    The FileAttributes property determines and changes the attributes for the file specified in the FileName property.    Value        Meaning
 fiaArchive        The file is an archive file. Applications use this value to mark files for backup or removal;
 fiaHidden        The file is hidden. It is not included in an ordinary directory listing;
 fiaReadOnly        The file is read-only. Applications can read the file but cannot write to it or delete it;
 fiaSystem        The file is part of the operating system or is used exclusively by it;
 fiaDirectory        The file is a directory; 
Dip 你好:
(1)先試試看,醬子寫行不行呢?
    St="Attributes: ">
(2)不過在 BCB 裡面查詢不到 TdcFileInfoAttributes 這個 class,比較相近
   的 class 是 TSearchRec,建議你自己查詢 BCB Help 的相關說明 (以上的
   範例程式碼,就是依照 TSearchRec 的資料結構來寫的)
(3)相關的用法包括 FindFirst, FindNext...你可以依此關鍵字,利用本站的搜
   尋功能,就可以找到很多這方面的討論文章,以及範例程式碼
(4)例如這一篇:搜尋檔案範例
   http://delphi.ktop.com.tw/topic.php?TOPIC_ID=44866
-- Enjoy Researching & Developing -- 發表人 - RaynorPao 於 2004/09/13 16:40:50
------
-- 若您已經得到滿意的答覆,請適時結案!! --
-- 欲知前世因,今生受者是;欲知來世果,今生做者是 --
-- 一切有為法,如夢幻泡影,如露亦如電,應作如是觀 --
Dip
一般會員


發表:6
回覆:4
積分:2
註冊:2004-04-19

發送簡訊給我
#3 引用回覆 回覆 發表時間:2004-09-13 17:38:14 IP:210.243.xxx.xxx 未訂閱
已經徹底放棄它了. 其實只是想把ReadOnly給去了. 都怪我笨, FileSetReadOnly() 放著不用.白繞了一大圈.. 不好意思,給您添麻煩了.
系統時間:2024-05-06 13:20:18
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!