运行这段代码不就知道了!!procedure TForm1.Button1Click(Sender: TObject); begin if fileExists ('c:\windows\notepad.exe') then showMessage('find!'); if fileExists ('C:\WINdowS\NotePAd.ExE') THEN sHOWmESSAGE('FIND AgaiN!'); end;Windows操作系统是不区分文件名的大小写的,但winnt/2000/xp 可以保存文件的大小写格式。 fileExists函数中的文件名也是不用区分大小写的。
2、你可以看看UpperCase和LowerCase两个大小写转换的函数
ansicomparestr 函数 比较字符串(区分大小写)
ansicomparetext 函数 比较字符串(不区分大小写)
ansilowercase 函数 将字符转换为小写
ansiuppercase 函数 将字符转换为大写
郁闷...
------------------------------------------------------------------------
先确定一下到底是不是大小写的问题?
你写成 FileExists (C:\cs\xp.dem')好用吗?如果好用的话,就用 LowerCase转换吧
begin
if fileExists ('c:\windows\notepad.exe') then
showMessage('find!');
if fileExists ('C:\WINdowS\NotePAd.ExE') THEN
sHOWmESSAGE('FIND AgaiN!');
end;Windows操作系统是不区分文件名的大小写的,但winnt/2000/xp 可以保存文件的大小写格式。 fileExists函数中的文件名也是不用区分大小写的。