VFP 愛用者社區 首頁 VFP 愛用者社區
本討論區為 Visual Foxpro 愛用者經驗交流的地方, 請多多利用"搜尋"的功能, 先查看看有無前例可循, 如果還有不懂的再發問. 部份主題有附加檔案, 須先註冊成為社區居民才可以下載.
 
 常見問題常見問題   搜尋搜尋   會員列表會員列表   會員群組會員群組   會員註冊會員註冊 
 個人資料個人資料   登入檢查您的私人訊息登入檢查您的私人訊息   登入登入

是否可利用VFP 调用 WIN API函数,修改驱动器号设置?

 
發表新主題   回覆主題    VFP 愛用者社區 首頁 -> VFP 討論區
上一篇主題 :: 下一篇主題  
發表人 內容
cathysia



註冊時間: 2004-12-01
文章: 4


第 1 樓

發表發表於: 星期三 十二月 01, 2004 11:03 am    文章主題: 是否可利用VFP 调用 WIN API函数,修改驱动器号设置? 引言回覆

我这边没有繁体中文的输入法,请各位高手将就一下吧:

有没有可能,利用VFP的程序调用WIN API的函数,实现利用程序修改系统驱动器号设置的可能?

如我是WIN2k的操作系统, 有一个系统盘 C:\, 一个数据盘D:\, 一个CD-ROOM (E:\), 想利用VFP程序, 实现把以上的设置改成 系统盘(C:\), 数据盘(E:\), CD-ROOM (D:\)
回頂端
檢視會員個人資料 發送私人訊息 MSN Messenger
garfield
Site Admin


註冊時間: 2003-01-30
文章: 2160


第 2 樓

發表發表於: 星期三 十二月 01, 2004 5:10 pm    文章主題: 引言回覆

檢查 cdrom 是那個個槽還比較簡單, 你想的方法有誰會知道啊!
_________________
利用>>搜尋<<的功能會比問的還要快得到答案.
回頂端
檢視會員個人資料 發送私人訊息 發送電子郵件
cathysia



註冊時間: 2004-12-01
文章: 4


第 3 樓

發表發表於: 星期四 十二月 02, 2004 9:10 am    文章主題: 引言回覆

Shocked 就是因为不知道才问各路高手啊,知道了我还问来干什么呢?
回頂端
檢視會員個人資料 發送私人訊息 MSN Messenger
syntech



註冊時間: 2003-05-16
文章: 4249
來自: Taipei,Taiwan

第 4 樓

發表發表於: 星期四 十二月 02, 2004 9:30 am    文章主題: 引言回覆

client:WIN 2000 /XP
server:win srv 2000,win srv 2003

取自 MSDN "Platform SDK: Storage "

---------------------------------------------
Assigning a Drive Letter to a Volume
You can assign a drive letter (for example, x:\) to a local volume using SetVolumeMountPoint, provided there is no volume already assigned to that drive letter. If the local volume already has a drive letter then SetVolumeMountPoint will fail. To handle this, first delete the drive letter using DeleteVolumeMountPoint. For example code, see Editing Drive Letter Assignments.


The system supports at most one drive letter per volume. Therefore, you cannot have C:\ and F:\ represent the same volume.

Caution Deleting an existing drive letter and assigning a new one may break existing paths, such as those in desktop shortcuts. It may also break the path to the program making the drive letter changes. With Windows virtual memory management, this may break the application, leaving the system in an unstable and possibly unusable state. It is the program designer's responsibility to avoid such potential catastrophes.

_________________
如果公司有下列困擾:
1. 找不到便宜,快速,簡易的 生產排程軟體
2. 不知道如何快速排定 採購計劃
3. 成本抓不準,自己算比軟體算有用
4. 想學習系統規劃,想找系統架構的顧問

請聯絡我們,也許我們幫得上忙
回頂端
檢視會員個人資料 發送私人訊息 發送電子郵件 AIM Address
syntech



註冊時間: 2003-05-16
文章: 4249
來自: Taipei,Taiwan

第 5 樓

發表發表於: 星期四 十二月 02, 2004 9:33 am    文章主題: 引言回覆

Platform SDK: Storage
SetVolumeMountPoint

The SetVolumeMountPoint function mounts the specified volume at the specified volume mount point.


BOOL SetVolumeMountPoint(
LPCTSTR lpszVolumeMountPoint,
LPCTSTR lpszVolumeName
);

Parameters
lpszVolumeMountPoint
[in] Pointer to a string that indicates the volume mount point where the volume is to be mounted. This may be a root directory (X:\) or a directory on a volume (X:\mnt\). The string must end with a trailing backslash ('\').
lpszVolumeName
[in] Pointer to a string that indicates the volume to be mounted. This string must be a unique volume name of the form "\\?\Volume{GUID}\" where GUID is a GUID that identifies the volume. The \\?\ turns off path parsing and is ignored as part of the path, as discussed in Naming a Volume. For example, "\\?\C:\myworld\private" is seen as "C:\myworld\private".
Return Values
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks
It is not an error to attempt to mount a volume at a volume mount point at which a volume is already mounted. In this case, the system unmounts the preceding volume without sending notifications before attempting to mount the new volume.

It is an error to attempt to mount a volume on a directory that has any files or subdirectories in it. This error occurs for system and hidden directories as well as other directories, and it occurs for system and hidden files.

When mount points are created in a clustered drive, they may be unexpectedly deleted under certain circumstances. For information on how to create and configure mounted drives to ensure that this does not happen, see the "Cluster Disk and Drive Connection" troubleshooting topic in the Server Clusters section of the Windows 2000 Server online help.

To compile an application that uses this function, define the _WIN32_WINNT macro as 0x0500 or later. For more information, see Using the SDK Headers.

Example Code
For an example, see Mounting a Volume at a Mount Point .

Requirements
Client: Requires Windows XP or Windows 2000 Professional.
Server: Requires Windows Server 2003 or Windows 2000 Server.
Unicode: Implemented as Unicode and ANSI versions.
Header: Declared in Winbase.h; include Windows.h.
Library: Use Kernel32.lib.


See Also
Volume Mount Points, Volume Management Functions, DeleteVolumeMountPoint, GetVolumeNameForVolumeMountPoint, GetVolumePathName

_________________
如果公司有下列困擾:
1. 找不到便宜,快速,簡易的 生產排程軟體
2. 不知道如何快速排定 採購計劃
3. 成本抓不準,自己算比軟體算有用
4. 想學習系統規劃,想找系統架構的顧問

請聯絡我們,也許我們幫得上忙
回頂端
檢視會員個人資料 發送私人訊息 發送電子郵件 AIM Address
syntech



註冊時間: 2003-05-16
文章: 4249
來自: Taipei,Taiwan

第 6 樓

發表發表於: 星期四 十二月 02, 2004 9:34 am    文章主題: 引言回覆

Platform SDK: Storage
DeleteVolumeMountPoint

The DeleteVolumeMountPoint function unmounts the volume from the specified volume mount point.


BOOL DeleteVolumeMountPoint(
LPCTSTR lpszVolumeMountPoint
);

Parameters
lpszVolumeMountPoint
[in] Pointer to a string that indicates the volume mount point to be unmounted. This may be a root directory (X:\, in which case the DOS drive letter assignment is removed) or a directory on a volume (X:\mnt\). A trailing backslash is required.
Return Values
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks
It is not an error to attempt to unmount a volume from a volume mount point when there is no volume actually mounted at that volume mount point.

To compile an application that uses this function, define the _WIN32_WINNT macro as 0x0500 or later. For more information, see Using the SDK Headers.

Example Code
For an example, see Unmounting a Volume at a Mount Point.

Requirements
Client: Requires Windows XP or Windows 2000 Professional.
Server: Requires Windows Server 2003 or Windows 2000 Server.
Unicode: Implemented as Unicode and ANSI versions.
Header: Declared in Winbase.h; include Windows.h.
Library: Use Kernel32.lib.


See Also
Volume Mount Points, Volume Management Functions, GetVolumeNameForVolumeMountPoint, GetVolumePathName, SetVolumeMountPoint

_________________
如果公司有下列困擾:
1. 找不到便宜,快速,簡易的 生產排程軟體
2. 不知道如何快速排定 採購計劃
3. 成本抓不準,自己算比軟體算有用
4. 想學習系統規劃,想找系統架構的顧問

請聯絡我們,也許我們幫得上忙
回頂端
檢視會員個人資料 發送私人訊息 發送電子郵件 AIM Address
從之前的文章開始顯示:   
發表新主題   回覆主題    VFP 愛用者社區 首頁 -> VFP 討論區 所有的時間均為 台北時間 (GMT + 8 小時)
1頁(共1頁)

 
前往:  
無法 在這個版面發表文章
無法 在這個版面回覆文章
無法 在這個版面編輯文章
無法 在這個版面刪除文章
無法 在這個版面進行投票
無法 在這個版面附加檔案
無法 在這個版面下載檔案


Powered by phpBB © 2001, 2005 phpBB Group
正體中文語系由 phpbb-tw 維護製作