使用FileSavePicker保存文件时不提示 [英] using FileSavePicker to save files without prompting
问题描述
我开发利用中,我要救它已经完成录制后自动音频C#中的Windows 8应用。我用FileSavePicker,每次它会打开一个文件保存窗口。不过,我想它没有及时出现。我已输入的文件名,并在FileSavePicker对象的编码。剩下的唯一的事就是静静地保存它。请帮助。
I am developing a Windows 8 app using C# in which I have to save an audio automatically after it has finished recording. I used FileSavePicker and everytime it opens a file save window. However, I want it to happen without the prompt. I have already entered the file name and the encoding in the FileSavePicker object. The only thing remaining is saving it quietly. Please Help.
感谢。
推荐答案
我找到了答案由使用 CreateFileAsync
保存(下FileSavePicker)常用的语法是:
The usual syntax for saving (under FileSavePicker) was:
VAR媒体文件=等待_fileSavePicker.PickSaveFileAsync();
如果我取代了它:
StorageFile媒体文件=等待Windows.Storage.KnownFolders.MusicLibrary.CreateFileAsync(file1.mp3,Windows.Storage.CreationCollisionOption.ReplaceExisting);
问题解决了!我也不得不在应用功能添加的音乐库。
The problem was solved! I also had to add music library in the app capabilities.
这篇关于使用FileSavePicker保存文件时不提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!