(X) Hide this
    • Login
    • Join
      • Say No Bots Generate New Image
        By clicking 'Register' you accept the terms of use .
        Login with Facebook

Silverlight 2 reducing Isolated Storage Quota

(0 votes)
2 comments   /   aggregated from .NET, Silverlight, and other ramblings (from the U on Apr 21, 2008   /   original article
Categories:   General
Now that I am back from holiday, it is time to blog a little.

I've been messing around with Isolated Storage for the past few days, and there is some interesting issues.

It seems to me i can increase the Isolated Storage quota (the amount of allocated isolated storage), but I don't seem to have anyway to reduce it (in the beta)?

The following code will ask the user permission to increase the quota to 1Mb (default starting quota is 100Kb)


using (IsolatedStorageFile userStore =
IsolatedStorageFile.GetUserStoreForApplication())
{
userStore.TryIncreaseQuotaTo(1048576);
}


which is all lovely and stuff, but I have no way to reduce the quota size in the future. The only way to mess with the quota is to use TryIncreaseQuotaTo, however if you attempt set the quota to a value less than your current quota, it throws an exception.

I also tried killing my isolated storage (to no avail):


using (IsolatedStorageFile userStore =
IsolatedStorageFile.GetUserStoreForApplication())
{
userStore.Remove();
}


I think it would be better if an exception was thrown if you attempted to reduce the quota below the used space (userStore.Quota - userStore.AvailableFreeSpace)

Subscribe

Comments

  • -_-

    RE: Silverlight 2 reducing Isolated Storage Quota


    posted by Paul on Aug 12, 2009 18:02
    Why would you want to reduce your quota? Why not just not use all of it? The user has given you rights to it. 
  • -_-

    RE: Silverlight 2 reducing Isolated Storage Quota


    posted by bingo depluma on Jan 31, 2010 05:48

    Where do i put this

    using (IsolatedStorageFile userStore =
                            IsolatedStorageFile.GetUserStoreForApplication())
                {
                    userStore.TryIncreaseQuotaTo(1048576);

Add Comment

Login to comment:
  *      *       
Login with Facebook