硬碟型態 |
尚未結案
|
kraen4468
初階會員 發表:66 回覆:112 積分:35 註冊:2003-12-04 發送簡訊給我 |
|
conundrum
尊榮會員 發表:893 回覆:1272 積分:643 註冊:2004-01-06 發送簡訊給我 |
|
kraen4468
初階會員 發表:66 回覆:112 積分:35 註冊:2003-12-04 發送簡訊給我 |
|
conundrum
尊榮會員 發表:893 回覆:1272 積分:643 註冊:2004-01-06 發送簡訊給我 |
|
kraen4468
初階會員 發表:66 回覆:112 積分:35 註冊:2003-12-04 發送簡訊給我 |
|
axsoft
版主 發表:681 回覆:1056 積分:969 註冊:2002-03-13 發送簡訊給我 |
conundrum兄是要您用TRegistry 來讀Registry的內容,但如果Registry中沒有那你要的資訊那...就準被乾瞪眼吧..
如果您要寫Hardware informan的東西,建議您從Windows DDK 的SetupDiXXXXX API著手吧! 參考網頁
http://www.csdn.net/develop/author/netauthor/bhw98/ Delphi範例:
http://delphi.ktop.com.tw/loadfile.php?TOPICID=14008954&CC=313306
BCB中需要作下面準備工作 1.在C++ Builder 6 中C:\Program Files\Borland\CBuilder6\Lib\Psdk\SetupAPI.LIB 加入您的Project File 2.#include3.這有位Ktop會員寫的Source Code( Sorry...忘了是那位了) //.cpp #include /*生活是一種藝術,用心生活才能享受生活*/發表人 - axsoft 於 2004/02/12 16:27:41 |
conundrum
尊榮會員 發表:893 回覆:1272 積分:643 註冊:2004-01-06 發送簡訊給我 |
|
kraen4468
初階會員 發表:66 回覆:112 積分:35 註冊:2003-12-04 發送簡訊給我 |
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.這是我後來找到的 謝謝大大前面的保貴資料 ~我還在學習狀態希望多多向您學習~ |
kraen4468
初階會員 發表:66 回覆:112 積分:35 註冊:2003-12-04 發送簡訊給我 |
|
axsoft
版主 發表:681 回覆:1056 積分:969 註冊:2002-03-13 發送簡訊給我 |
引言: 我試了GetDriveType的API可是都寫不出來 可以請大大教我這個API怎麼用嗎 ~我還在學習狀態希望多多向您學習~ Kraen4468您好: void __fastcall TForm1::Button1Click(TObject *Sender) { AnsiString Drive = "C:\\"; int type = GetDriveType( Drive.c_str() ); AnsiString DriveType; if ( type == 0 ){ DriveType = "The drive type cannot be determined."; } else if ( type == 1 ){ DriveType = "The root directory does not exist."; } else if ( type == 2 ){ DriveType = "The drive can be removed from the drive"; } else if ( type == 3 ){ DriveType = "The disk cannot be removed from the drive."; } else if ( type == 4 ){ DriveType = "The drive is a remote (network) drive."; } else if ( type == 5 ){ DriveType = "The drive is a CD-ROM drive."; } else if ( type == 6 ){ DriveType = "The drive is a RAM disk."; } MessageDlg( DriveType, mtInformation, TMsgDlgButtons() << mbOK, 0 ); } /*生活是一種藝術,用心生活才能享受生活*/ |
kraen4468
初階會員 發表:66 回覆:112 積分:35 註冊:2003-12-04 發送簡訊給我 |
|
axsoft
版主 發表:681 回覆:1056 積分:969 註冊:2002-03-13 發送簡訊給我 |
引言:kraen4468 c_str()是將AnsiString 轉為轉為字元陣列格式 建議您多看看C Builder 基礎的書籍Drive.c_str()可以問一個小問題嗎後面加.c_str()是什麼意思呢 ~我還在學習狀態希望多多向您學習~ AnsiString 字串處理 在C語言裡,字串處理多用字元陣列來做,使用上不很親切。 在C Builder中,實作了AnsiString 類別來處理字串,提供更好的選擇。(AnsiString 可以 String表示) String str; str=String("This is a line of text"); // 建構子 str=String(0); // 建構子 str=String(34.234); // 建構子 String stra=String("String a"); String strb=String("String b"); String strc; strc=stra strb; // 字串的串接 if(stra.AnsiCompare(strb)) // 字串的比較 {...} int index; index=strc.AnsiPos("ring"); // 子字串的尋找 MessageBox(strc.c_str(),stra.c_str(),MB_OK); // 轉為字元陣列格式 index=strc.Length(); // 字串長度 str=strc.SubString(3,4); // 擷取子字串 str=strc.UpperCase(); // 全改為大寫字母 str=strc.LowerCase(); // 全改為小寫字母 int x; str="20"; x=str.ToInt(); // 轉為整數 float r; str="20.334"; r=str.ToDouble(); // 轉為浮點數 /*生活是一種藝術,用心生活才能享受生活*/發表人 - axsoft 於 2004/02/13 19:07:57 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |