有没有其他方法可以检查Windows应用商店应用中是否存在文件?
try
{
var file = await ApplicationData.Current.LocalFolder.GetFileAsync("Test.xml");
//no exception means file exists
}
catch (FileNotFoundException ex)
{
//find out through exception
}
Run Code Online (Sandbox Code Playgroud) c# filenotfoundexception microsoft-metro windows-8 windows-runtime