词条 | 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 ValueIf the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError. RemarkEach 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条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。