سؤال

I am trying to delete files from isolated storage. But it returning error message to me. I don't know where i did mistake.

public void Delete(string folder, string fileName)
    {
        try
        {
            string path = folder + "\\" + fileName + ".txt";
            string delPath = folder + "/" + fileName + ".txt";
            MessageBox.Show(delPath);
            if (myIsolatedStorage.DirectoryExists(folder))
            {
                if (myIsolatedStorage.FileExists(delPath))
                {
                    myIsolatedStorage.DeleteFile(delPath);
                    MessageBox.Show("File is Deleted..!!");
                }
                else
                    MessageBox.Show("There is no file is exists");
            }
            else
            {
                MessageBox.Show("There is no Folder is exists");
            }

        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.ToString());
        }
    }

Please let me know where i did mistake. Thanks in advance..

Error message:-

enter image description here

هل كانت مفيدة؟

المحلول

Perhaps, the file, you're trying to delete, is still in usage. Your application should have no open files or references to files that you are trying to delete.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top