I need to create a ListBox with saved files in ApplicationData.Current.LocalFolder, that I can later use to open these files.
I have something like this:
string path = ApplicationData.Current.LocalFolder;
DirectoryInfo dinfo = new DirectoryInfo(@path);
FileInfo[] Files = dinfo.GetFiles("*.txt");
foreach (FileInfo file in Files)
{
listbox1.Items.Add(file.Name);
}
But even though I found some sample code that just assigns ApplicationData.Current.LocalFolder directly to string, I get an error: "Cannot implicitly convert "Windows.Storage.StorageFoler" to string."
Can you tell me how to do it?
Thanks
Ok,
I have solved it myself, so for anyone looking for an answer, here you go: