Check if File Exists or not in Windows Runtime Apps

  1. private async Task<bool> IsFileExists(string fileName)  
  2. {  
  3.     try  
  4.     {  
  5.         StorageFile file = await ApplicationData.Current.LocalFolder.GetFileAsync(fileName);  
  6.         return true;  
  7.     }  
  8.     catch (Exception)  
  9.     {  
  10.         return false;  
  11.     }