var appFolder = await KnownFolders.DocumentsLibrary.CreateFolderAsync("Test");
Update: Got it - Used Above Line.------
var folder = KnownFolders.DocumentsLibrary;
StorageFolder subFolder = await folder.GetFolderAsync("Test");
List<string> fileTypeFilter = new List<string>();
fileTypeFilter.Add(".txt");
QueryOptions queryOptions = new QueryOptions(Windows.Storage.Search.CommonFileQuery.OrderByName, fileTypeFilter);
StorageFileQueryResult queryResult = subFolder.CreateFileQueryWithOptions(queryOptions);
var files = await queryResult.GetFilesAsync();
foreach (var file in files)
{
string name = file.Name;
Debug.WriteLine(name);
}
Learning to build for UWP
. Here is the code to get all the text files from a folder in the Documents folder. But I want to create the Test
folder if it doesn't exist in the documents folder.