How to check if file exists in a Windows Store App?

前端 未结 10 2033
小鲜肉
小鲜肉 2020-11-30 07:25

Is there any other way of checking whether a file exists in a Windows Store app?

try
{
    var file = await ApplicationData.Current.LocalFolder.GetFileAsync(         


        
10条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-30 07:59

    The other means to check is by getting files in local folder

        var collection =  ApplicationData.Current.LocalFolder.GetFilesAsync() 
    

    Using this method and then iterating over all the elements in the collection and check for its availability.

提交回复
热议问题