如何删除isolatedsotrage文件 [英] How to remove an isolatedsotragefile
问题描述
你好
我有一个录音机应用程序,我让它录制并保存人们的录音但是当我点击并按住时我得到一个删除选项,当我点击删除选项我想删除.wav文件,但我不知道如何做到这一点。这是我的保存代码,如果有帮助
I have a recorder app, I get it to record and save people's recordings but then when I tap and hold I get a delete option, when I click that delete option I want to delete the .wav file but I have no idea how to do this. Here is my save code if that helps
  if(e.PopUpResult == PopUpResult.Ok)
{
SoundData soundData = new SoundData();
soundData.FilePath =的String.Format(QUOT; / customAudio / {0}的.wav" ;, DateTime.Now.ToFileTime());
      &NBSP ;         soundData.Title = e.Result;
if (e.PopUpResult == PopUpResult.Ok)
{
SoundData soundData = new SoundData();
soundData.FilePath = string.Format("/customAudio/{0}.wav", DateTime.Now.ToFileTime());
soundData.Title = e.Result;
               使用(IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication())
                {
如果(!isoStore.DirectoryExists(QUOT; / customAudio"))
                         isoStore.CreateDirectory(QUOT; / customAudio");
using (IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication())
{
if (!isoStore.DirectoryExists("/customAudio"))
isoStore.CreateDirectory("/customAudio");
                     isoStore.MoveFile(_tempFileName,soundData.FilePath);
                }
isoStore.MoveFile(_tempFileName, soundData.FilePath);
}
App.ViewModel.CustomSounds.Items.Add(soundData);
App.ViewModel.CustomSounds.Items.Add(soundData);
                 VAR数据= JsonConvert.SerializeObject(App.ViewModel.CustomSounds);
var data = JsonConvert.SerializeObject(App.ViewModel.CustomSounds);
            &NBSP ;   IsolatedStorageSettings.ApplicationSettings [SoundModel.CustomSoundKey] =数据;
                IsolatedStorageSettings.ApplicationSettings.Save();
IsolatedStorageSettings.ApplicationSettings[SoundModel.CustomSoundKey] = data;
IsolatedStorageSettings.ApplicationSettings.Save();
 
                 NavigationService.Navigate(新URI(" /MainPage.xaml" ;, UriKind.RelativeOrAbsolute));
NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.RelativeOrAbsolute));
             }
}
谢谢,请帮忙提出任何建议。
thank you, please help with any suggestions.
推荐答案
还有一个删除方法
这篇关于如何删除isolatedsotrage文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!