【MSDN】由文件路径获得文件名--PathFindFileName()函数
来源:互联网 发布:理财软件排名 编辑:程序博客网 时间:2024/05/17 09:02
今天偶然翻看MFC源代码,发现了一个函数PathFindFileName(),这个函数的作用就是用来获取路径中的文件名的。下面是MSDN的文档。
LPTSTR PathFindFileName( LPCTSTR pPath );
Searches a path for a file name.
- Returns a pointer to the address of the string if successful, or a pointer to the beginning of the path otherwise.
- pPath
- Address of the file name for which to search.
在MSDN中还发现了以下函数:
由文件路径判断文件是否存在的函数
BOOL PathFileExists( LPCTSTR lpszPath );
Determines if a file exists.
- Returns TRUE if the file exists, or FALSE otherwise.
- lpszPath
- Address of the file to verify.
This function will test for the validity of the file and path.
由文件路径获得文件扩展名的函数
LPTSTR PathFindExtension( LPCTSTR pPath );
Searches a path for an extension.
- Returns the address of the "." preceding the extension within pPath if an extension is found, or the address of the trailing NULL character otherwise.
- pPath
- Address of the path that contains the extension for which to search.
由文件路径返回下一层路径的函数
LPTSTR PathFindNextComponent( LPCTSTR pszPath );
Parses a path for the next path component. Paths are delimited by backslashes or by the NULL at the end of the path.
- Returns the address of the start of the next path component if successful, or NULL otherwise.
- pszPath
- Address of the path to search.
在给定的目录下搜索指定文件的函数
BOOL PathFindOnPath( LPTSTR pszFile, LPCTSTR * ppszOtherDirs );
Finds a file within a given path.
- Returns TRUE if successful, or FALSE otherwise.
- pszFile
- Address of the file name for which to search.
- ppszOtherDirs
Address of the path to be searched.
转自:http://blog.163.com/lvan100@yeah/blog/static/681172142010118114235316/
- 【MSDN】由文件路径获得文件名--PathFindFileName()函数
- PathFindFileName函数,由文件路径获得文件名
- PathFindFileName函数,由文件路径获得文件名
- dedecms 获得文件路径,文件名
- 由文件路径获得扩展名
- Qt 读取文件,获得文件名、路径
- VB如何从文件路径名中获得文件名?
- C++获得文件夹下所有文件的路径及文件名
- 获得一个路径的文件文件名(4种方法)
- 常用文件路径和文件名处理函数
- VC++文件路径和文件名处理函数
- 常用文件路径和文件名处理函数
- VC++文件路径和文件名处理函数
- PathFindFileName
- 用_splitpath 函数可以分解出路径,文件名,扩展名,msdn的例子
- vc获得路径中的文件名
- 如何获得文件路径名、带后缀的文件名、不带后缀的文件名。
- 由窗句柄获得对应可执行文件名
- java class 关系分析辅助工具
- 汉诺塔(二)
- 【收藏】实用软件
- 黑马程序员_面试题一(交通灯管理系统)
- Change Flash Builder Default Src Folder Name?
- 【MSDN】由文件路径获得文件名--PathFindFileName()函数
- 嵌入式 简单的读取文件并打印指定字符串的值
- 一个开发苹果系统软件常用得makefile,感谢强哥
- c++四种强制类型转换
- fail to read row 0,column -1
- adf oracle popup 内置table 无刷新
- 根据新浪天气API获取各地天气状况(Java实现)
- 画图-Graphics 类简介
- 嵌入式 简单的tcp_client程序可传入参数服务器的IP和PORT,接受buf并存储文件