您的位置:首页 > 其它

判断文件是否存在一个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!');
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: