导航:  Windows Procedures >

AfxPathAddExtension

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

描述

 

将文件扩展名添加到路径字符串.

 

FreeBASIC 语法

 

FUNCTION AfxPathAddExtension ( _

  BYREF wszPath AS CONST WSTRING, _

  BYVAL pwszExt AS WSTRING PTR = NULL _

) AS CWSTR

 

参数

 

wszPath

 

将追加文件名扩展名的字符串.

 

wszExtension

 

包含文件扩展名的字符串.

 

返回值

 

改变路径.

 

备注

 

如果已经存在文件扩展名,则将不添加扩展名.如果bstrPath是空字符串,结果将是唯一的文件扩展名.如果bstrExtension是空字符串,一个'.exe'的推广将增加.

 

引用文件

 

AfxPath.inc

 

Sample Code

 

DIM cws AS CWSTR = AfxPathAddExtension("file") - output: file.exe

DIM cws AS CWSTR = AfxPathAddExtension("file.doc") - output: file.doc

DIM cws AS CWSTR = AfxPathAddExtension("file", ".txt") - output: file.txt

DIM cws AS CWSTR = AfxPathAddExtension("", ".txt") - output: .txt