0

我正在开发一个使用文件输入和输出的 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);

现在如何在我创建的文件夹中创建/保存我的文件?

4

1 回答 1

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);
于 2012-12-11T11:57:28.023 回答