当我返回" FileExists#34;这段代码中的变量我收到错误..
public static async Task<bool> FileExistsForWp8(string filename)
{
StorageFolder folder = Windows.Storage.ApplicationData.Current.LocalFolder;
try
{
StorageFile FileExists = await folder.GetFileAsync(filename);
return FileExists;
}
catch (Exception ex)
{
return FileExists;
}
}
答案 0 :(得分:1)
你的意思:
public static async Task<bool> FileExistsForWp8(string filename)
{
StorageFolder folder = Windows.Storage.ApplicationData.Current.LocalFolder;
try
{
StorageFile File = await folder.GetFileAsync(filename);
return true;
}
catch
{
return false;
}
}