请输入您要查询的百科知识:

 

词条 SetCurrentDirectory
释义

简介

切换当前进程的当前工作目录。

函数原型

VC函数原型

BOOL WINAPI SetCurrentDirectory( __in LPCTSTR lpPathName);

参数说明

lpPathName [in]

The path to the new current directory. This parameter may specify a relative path or a full path. In either case, the full path of the specified directory is calculated and stored as the current directory. For more information, see File Names, Paths, and Namespaces.

The string must not exceed MAX_PATH characters, including the terminating null character. The final character before the null character must be a backslash ('\\'). If you do not specify the backslash, it will be added for you; therefore, specify MAX_PATH-2 characters for the path unless you include the trailing backslash, in which case, specify MAX_PATH-1 characters for the path.

Return Value

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.

Remark

Each process has a single current directory made up of two parts:

A disk designator that is either a drive letter followed by a colon, or a server name and share name (\\\\servername\\sharename)A directory on the disk designator

VB声明

Declare Function SetCurrentDirectory Lib "kernel32" Alias "SetCurrentDirectoryA" (ByVal lpPathName As String) As Long

说明

设置当前目录

返回值

Long,非零表示成功,零表示失败。会设置GetLastError

参数表

参数 类型及说明

lpPathName String,新目录的路径

随便看

 

百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。

 

Copyright © 2004-2023 Cnenc.net All Rights Reserved
更新时间:2025/3/21 0:33:24