Sunday, 15 September 2013

How to check if a file exist in metro app without try catch

How to check if a file exist in metro app without try catch

I have 5 limited numbers of file in Database and I want to check weather
the name of file I want Exists or Not but without using an Exception
handler.
Code Known till now
try{
var localFolder = ApplicationData.Current.LocalFolder;
var file = await localFolder.GetFileAsync("data.txt");
}catch(Exception ex){
//file doesnot exist
}
But without this is there any way. ???

No comments:

Post a Comment