如何判斷檔案的來源位置?本機or網路? |
答題得分者是:pceyes
|
goat
高階會員 發表:53 回覆:130 積分:134 註冊:2002-06-03 發送簡訊給我 |
|
pceyes
尊榮會員 發表:70 回覆:657 積分:1140 註冊:2003-03-13 發送簡訊給我 |
在學BCB剛好看到這一段,使用GetDriveType Windows Api
檢查其本機型態,如 DRIVE_FIXED 本機磁碟機 DRIVE_REMOTE (NETWORK)DRIVEER DRIVE_REMOVABLE 可抽拔磁碟 : : Windows 32 Api Help 說明如下: 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. See Also GetDiskFreeSpace 有關delphi使用方式可以在網路找一下。
------
努力會更接近成功 |
pceyes
尊榮會員 發表:70 回覆:657 積分:1140 註冊:2003-03-13 發送簡訊給我 |
如何判斷是網路空間上的檔案還是硬碟空間的檔案
http://delphi.ktop.com.tw/board.php?cid=30&fid=69&tid=60538
------
努力會更接近成功 |
goat
高階會員 發表:53 回覆:130 積分:134 註冊:2002-06-03 發送簡訊給我 |
感謝pceyes,這正是我需要的,3Q。
===================引 用 pceyes 文 章=================== 如何判斷是網路空間上的檔案還是硬碟空間的檔案 http://delphi.ktop.com.tw/board.php?cid=30&fid=69&tid=60538 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |