Windows::Storage::StorageFile^ file;
Windows::Foundation::Uri^ path = ref new Windows::Foundation::Uri(L"ms-appx:///Assets/Note.txt");
file->GetFileFromApplicationUriAsync(path);
//here , file is nullptr!!! why? I make variable file as a class's member , and use file in another method delay some minites , but file still be 0x000000
if (file != nullptr)
{
create_task(FileIO::ReadTextAsync(file)).then([this, file](task<String^> task)
{
try
{
String^ fileContent = task.get();
// OutputTextBlock->Text = "The following text was read from '" + file->Name + "':\n\n" + fileContent;
}
catch(COMException^ ex)
{
// rootPage->HandleFileNotFoundException(ex);
}
});
}