目录使用说明(Directory Control)

本文介绍了用于访问、修改和获取目录结构信息的多种常规操作,包括更改当前工作目录、获取当前工作目录、创建新目录及删除目录等。这些操作在.NET Framework中有对应的实现,并提供了使用PInvoke调用标准C函数的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

These routines access, modify, and obtain information about the directory structure.

Routine

Use

.NET Framework equivalent

_chdir, _wchdir

Change current working directory

System::Environment::CurrentDirectory

_chdrive

Change current drive

System::Environment::CurrentDirectory

_getcwd, _wgetcwd

Get current working directory for default drive

System::Environment::CurrentDirectory

_getdcwd, _wgetdcwd

Get current working directory for specified drive

System::Environment::CurrentDirectory

_getdiskfree

Populates a _diskfree_t structure with information about a disk drive.

Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.

_getdrive

Get current (default) drive

System::Environment::CurrentDirectory

_getdrives

Returns a bitmask representing the currently available disk drives.

Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.

_mkdir, _wmkdir

Make new directory

System::IO::Directory::CreateDirectory, System::IO::DirectoryInfo::CreateSubdirectory

_rmdir, _wrmdir

Remove directory

System::IO::Directory::Delete

_searchenv, _wsearchenv, _searchenv_s, _wsearchenv_s

Search for given file on specified paths

Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值