偵測硬碟存不存在 |
尚未結案
|
kraen4468
初階會員 發表:66 回覆:112 積分:35 註冊:2003-12-04 發送簡訊給我 |
|
RaynorPao
版主 發表:139 回覆:3622 積分:7025 註冊:2002-08-12 發送簡訊給我 |
引言: 我想寫個偵測硬碟存不存在kraen4468 你好: 請參考以下的做法 < class="code"> for(char sz='C'; sz<='G'; sz++) { AnsiString szPath=(AnsiString)sz+":\\"; if(DirectoryExists(szPath)) { ShowMessage(szPath+" exist!"); } else { ShowMessage(szPath+" not exist!"); } } -- Enjoy Researching & Developing --for(ch='C';ch<='D';ch++) }可是不知道用那個API寫的出來 ~我還在學習狀態希望多多向您學習~
------
-- 若您已經得到滿意的答覆,請適時結案!! -- -- 欲知前世因,今生受者是;欲知來世果,今生做者是 -- -- 一切有為法,如夢幻泡影,如露亦如電,應作如是觀 -- |
aquarius
資深會員 發表:3 回覆:347 積分:330 註冊:2003-05-21 發送簡訊給我 |
引言: 我想寫個偵測硬碟存不存在請參考 GetDriveType 這個 API The GetDriveType function determines whether a disk drive is a removable, fixed, CD-ROM, RAM disk, or network drive. UINT GetDriveType( LPCTSTR lpRootPathName // address of root path ); Parameters lpRootPathName Points to a null-terminated string that specifies the root directory of the disk to return information about. If lpRootPathName is NULL, the function uses the root of the current directory. Return Values The return value specifies the type of drive. It can be one of the following values: Value Meaning 0 The drive type cannot be determined. 1 The root directory does not exist. DRIVE_REMOVABLE The drive can be removed from the drive. DRIVE_FIXED The disk cannot be removed from the drive. DRIVE_REMOTE The drive is a remote (network) drive. DRIVE_CDROM The drive is a CD-ROM drive. DRIVE_RAMDISK The drive is a RAM disk. ...Aquariusfor(ch='C';ch<='D';ch ) }可是不知道用那個API寫的出來 ~我還在學習狀態希望多多向您學習~
------
水瓶男的blog: http://791909.blogspot.com |
axsoft
版主 發表:681 回覆:1056 積分:969 註冊:2002-03-13 發送簡訊給我 |
kraen4468:
試著修改下面的範例:就是您要的答案:)
#include /*生活是一種藝術,用心生活才能享受生活*/發表人 - axsoft 於 2004/01/28 16:22:08 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |