Linux安全网 - Linux操作系统_Linux 命令_Linux教程_Linux黑客

会员投稿 投稿指南 本期推荐:
搜索:
您的位置: Linux安全网 > Linux编程 > » 正文

Windows_Programing_English_To_Chinese_1_MSVC_C运行库(15)

来源: 未知 分享至:

函数原型

int _getdrives(void);

Example

代码示例

ULONG DriveMask = _getdrives();

 

while(DriveMask)

{// list all the drives...

 //列出所有驱动器

  if(DriveMask & 1)

    printf(mydrives);

    ++mydrives[1];

   // shift the bit masks binary to the right and repeat

    DriveMask >>= 1;

}

The parameters

函数参数

void

The return value

函数返回值

If the function succeeds, the return value is a bitmask representing the currently available disk drives.

 Bit position 0 (the leastsignificant bit) is drive A, bit position 1 is drive B, bit position 2 is drive C, 

and so on. If the function fails, the return value is zero. 

To get extended error information, callGetLastError().

如果函数成功执行,那么返回一个代表当前可用驱动器的位旗标。D0位表示A盘, D1表示B盘, D2表示C盘,以此类推。 如果函数执行失败,那么返回一个非零值,可以通过GetLastError函数获取出错信息

The header file

要包含的头文件

<direct.h>

Table 5:  _getdrives() information

_getdrives() 函数使用信息

§ The following program example uses the _getdrives() function to list the available logical drives in the current machine.


Tags:
分享至:
最新图文资讯
1 2 3 4 5 6
验证码:点击我更换图片 理智评论文明上网,拒绝恶意谩骂 用户名:
关于我们 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 发展历史