win 8 app和c ++中是否存在文件? [英] Does file exist in win 8 app and c++ ?

查看:78
本文介绍了win 8 app和c ++中是否存在文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何为此函数创建任务并捕获文件是否不存在?

How do I create a task for this function and catch if the file doesn't exist ?

	int fileexist()
	{

		String^ fileName="arnold.pcb"; 
	
	StorageFolder^ item = KnownFolders::PicturesLibrary;
	
	try
	{
	item->GetFileAsync(fileName);
	}
	catch(...)
	{
		return 0;
	}

	return 1;


	}






n.Wright



n.Wright

推荐答案

讨论了这个问题
之前

当然,真正的问题是你为什么要做一个文件存在测试?如果您不需要该文件,为什么要打开它?

Of course, the real question is why are you doing a file exist test in the first place? If you don't need the file, why open it?


这篇关于win 8 app和c ++中是否存在文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆