2012-12-11 48 views
0

我正在開發一個使用文件輸入和輸出的metro應用程序。我用來保存文件的代碼是無法在C#metro應用程序所需的位置保存文件

StorageFolder appfolder = await Windows.Storage.KnownFolders.DocumentsLibrary.CreateFolderAsync("Appdata.abc", Windows.Storage.CreationCollisionOption.ReplaceExisting); 
StorageFile file = await Windows.Storage.KnownFolders.DocumentsLibrary.CreateFileAsync(DateFileName + ".uvraj", Windows.Storage.CreationCollisionOption.ReplaceExisting); 

現在如何創建/保存我創建的文件夾內的文件?

回答

1

調用appfolder對象上的方法,而不是您正在使用的KnownFolder

像這樣:

StorageFolder appfolder = await Windows.Storage.KnownFolders.DocumentsLibrary.CreateFolderAsync("Appdata.abc", Windows.Storage.CreationCollisionOption.ReplaceExisting); 
StorageFile file = await appfolder.CreateFileAsync(DateFileName + ".uvraj", Windows.Storage.CreationCollisionOption.ReplaceExisting); 
+0

偉大工程....感謝名單了很多...... – uvishere

相關問題