How to change the default storage quota of isolatedstorage

Source: Internet
Author: User

The last time we talked about how to change the default storage quota of isolatedstorage, I will introduce how to view the current usage of isolatedstorage.

First, open the Silverlight configuration page ):

Select ApplicationProgramStorage (Application storage) tab:

The current storage status is clear at a glance ~ Of course, I can also get these attributes in the program.

Using (Isolatedstoragefile ISF = Isolatedstoragefile. getuserstoreforapplication ())
{
ISF. availablefreespace. tostring () +   " Bytes " ; // Here is the remaining space
ISF. Quota. tostring () +   " Bytes " ; // Here is the current quota
(ISF. Quota - ISF. availablefreespace). tostring () +   " Bytes " ; // Here is the space used by the user
}

Okay. Now let's see how to change the default quota ~

 

Using (Isolatedstoragefile ISF = Isolatedstoragefile. getuserstoreforapplication ())
{
Try
{
If ( True   = ISF. increasequotato ( 1048576   *   2 )) // Increase the quota to 2 MB (note: the unit here is bytes)
{
Results. Text= "Quota changed successfully.";
}
Else
{
Results. Text= "Quota change failed.";
}
}
Catch (Exception E)
{
System. Windows. browser. htmlpage. Window. Alert (E. Message );
}
}

Easy ~ Some may ask where we stored the data last time.

This information should be reported in c: \ Users \ sonic \ appdata \ locallow \ Microsoft \ Silverlight \ is \ gsp5lhdk. hho \ ulgnbrmt. oex \ 1 \ s \ Users \ f \ sonic.txt

 

Source code: isolatedstoragedemo2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.