PathFileExists 函数可以用来查看一个文件或文件夹是否存在。
在使用这个函数时,需加入#include <shlwapi.h>。并在projiect->setting->link下objiect/library modules中加入shlwapi.lib.
eg:
#include<windows.h>
#include<stdio.h>
#include "shlwapi.h"
main()
{
char buffer[]="c:\\test\\";//文件夹
char *p=buffer;
int a;
a=PathFileExists(p);
if(a==1)
printf("yes\n");
else
printf("no\n");
}
联系客服