开发者

I want to delete the files stored in Isolated Storage when the OOB app is removed

I want to delete the files stored in Isolated Storage when the OOB app is removed. How can i delete 开发者_高级运维these files?

Thanks


Good question! This article describes how to automate this process whilst an application uninstallation:

The previous code in uses the IsolatedStorageFile.Remove() function to tidy up after itself, but obviously for a real application this is not a sensible approach! However, application developers should consider removing isolated storage when the application is uninstalled. Unfortunately there is no simple way to instruct your installer to do this so it has to be done programmatically in an Installer Class, overriding the Uninstall function:

public override void
    Uninstall(System.Collections.
    IDictionary savedState)
{
    IsolatedStorageFile isf =
        IsolatedStorageFile.GetStore(
        IsolatedStorageScope.Assembly |
        IsolatedStorageScope.User,
        (Type)null,
        (Type)null);
    isf.Remove();
    base.Uninstall(savedState);
}

see Uninstallation section for more details.

EDIT:

As AnthonyWJones mentioned there is difference between Silverlight and Desctop application isolated Storage models, so article I've referenced is not pretty helpful in scope of your question, sorry for that. I've found following SO post which saying that files still remain and user could delete them himself, I'm not sure whether an other option exists, will let you know if found anything.

SO Post: Isolated Storage, OOB, and Removing the App

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜