导航:  CFileSys Class >

GetAbsolutePathName

上一页返回章节概述下一页

描述

从提供的路径规范返回完整和明确的路径.

 

语法

 

FUNCTION GetAbsolutePathName ( _

   BYREF cwsPathSpec AS CWSTR _

) AS CWSTR

 

参数

cwsPathSpec

CWSTR.路径规格更改为完整且明确的路径.

 

返回值

 

CWSTR.路径名.

 

备注

 

A path is complete and unambiguous if it provides a complete reference from the root of the specified drive. A complete path can only end with a path separator character (\) if it specifies the root folder of a mapped drive.

 

Assuming the current directory is c:\mydocuments\reports, the following table illustrates the behavior of the GetAbsolutePathName method.

 

pathspec (JScript)

pathspec (VBScript)

Returned path

'丙:'

'丙:'

'C:\我的文档/报告'

'嗯…'

'嗯…'

'C:\我的文档'

':'

'丙:'

'丙:'

'C:*.* \\ may97'

'C:\ may97 * *.'

'C:\我的文档\报告\ *.* \ may97'

'区域'

'区域'

'C:\我的文档\报告\区'

'C:\,\,\我的文档'

'C:\,\,\我的文档'

'C:\我的文档'

 

引用文件

 

CFileSys.inc

 

示例

 

#INCLUDE ONCE "Afx/CFileSys.inc"

 

DIM pFileSys AS CFileSys

DIM cwsName AS CWSTR = pFileSys.GetAbsolutePathName("C:\MyFolder\Test.txt")