문제

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