我正在開發通用Windows平臺應用程序。 要繼續我需要從一個文件夾中的所有文件的文件名到一個字符串數組。 get文件方法在UWP中不起作用。我嘗試過使用Filepicker和Storagefolder,但我不知道如何將它放入字符串數組中。字符串數組中的文件名c#通用Windows
// C#
FolderPicker picker= new FolderPicker();
picker.FileTypeFilter.Add("*"); StorageFolder x = await picker.PickSingleFolderAsync();
Windows.Storage.AccessCache.StorageApplicationPermissions.FutureAccessList.AddOrReplace("PickedFolderToken", x);
string[] files = Directory.GetFiles(@"path\to\Assets");
textBlock.Text = files.Length.ToString();
在這裏添加您現有的代碼,所以我們有一些事情要做。 – Romain