判断文件是否存在一个API函数
2009-11-14 17:08
701 查看
一、声明(方式有两种):
1. function PathFileExists(pszPath:string):Bool;stdcall;external 'shlwapi.dll'Name'PathFileExistsA';
2. function PathFileExistsA(pszPath:string):Bool;stdcall;external 'shlwapi.dll';
二、使用(此处用第二种方式)://该函数的返回值为布尔型,0 或1,
if not PathFileExistsA('f:\pascal教程.doc') then
ShowMessage('File not find!')
else
showmessage('File exists!');
1. function PathFileExists(pszPath:string):Bool;stdcall;external 'shlwapi.dll'Name'PathFileExistsA';
2. function PathFileExistsA(pszPath:string):Bool;stdcall;external 'shlwapi.dll';
二、使用(此处用第二种方式)://该函数的返回值为布尔型,0 或1,
if not PathFileExistsA('f:\pascal教程.doc') then
ShowMessage('File not find!')
else
showmessage('File exists!');
相关文章推荐
- QTP 怎么判断一个文件是否存在
- 输入一个文件路径判断是否存在,并统计文件的行数(不用wc命令统计)
- Python: 判断一个路径是否存在,判断一个路径是文件还是目录,创建路径,创建文件, 删除路径,删除文件
- 判断本地系统目录下是否存在XML文件,如果不存在就创建一个XMl文件,若存在就在里面执行添加数据
- 请问怎么用javascript判断一个文件是否存在?
- python中判断一个文件是否存在
- 一个简单的判断文件是否存在的WIN API函数
- 判断某一个路径下某个资源文件是否存在
- 怎样使用 Python 来判断一个路径是否存在判断一个路径是文件还是目录
- bash如何判断一个文件是否存在
- 用VS打包时判断某一个文件是否已存在,如果存在,则不安装
- 用PL/SQL判断一个FTP服务器上的文件是否存在
- Lua判断一个目录或文件是否存在的方法
- nodejs如何判断一个文件、文件夹是否存在
- 如何判断一个文件或目录是否存在
- 批处理判断是否存在文件,存在则运行另外一个bat文件
- python判断文件是否存在,不存在就创建一个
- OC中关于NSFileManager判断是否存在某一个文件
- 判断本地系统目录下是否存在XML文件,如果不存在就创建一个XMl文件,若存在就在里面执行添加数据
- windows10UWP:如何判断一个文件或者文件夹是否存在?