File windows phone 8应用程序中的文件存在性检查

File windows phone 8应用程序中的文件存在性检查,file,windows-phone-8,File,Windows Phone 8,我的windows phone 8应用程序中的共享/传输/文件夹中有一些文件。现在我需要检查这些文件是否存在。我用这个方法 File.Exists("shared/transfers/" + fileName); 但此方法始终返回false,即使文件当前存在。怎么办 检查这是否有效 string fileName = "/shared/transfers/filename"; string localPath = Path.Combine(Windows.Storage.Application

我的windows phone 8应用程序中的共享/传输/文件夹中有一些文件。现在我需要检查这些文件是否存在。我用这个方法

File.Exists("shared/transfers/" + fileName);
但此方法始终返回false,即使文件当前存在。怎么办

检查这是否有效

string fileName = "/shared/transfers/filename";
string localPath = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, fileName); 
if (await File.FileExistsInPath(localPath)) 

对谢谢:)我想不用File.FileExistsInPath(localPath),你也可以用File.Exists()方法。我还没有试过,但可以。谢谢你接受我的回答!干杯