zoukankan      html  css  js  c++  java
  • 如何更改IsolatedStorage默认存储限额

    上次我们说到可以更改IsolatedStorage的默认存储限额,接下来我给大家介绍一下如何查看现在我们对IsolatedStorage的使用状况

    首先打开我们Silverlight配置页面(Silverlight Configuration):

    选择应用程序存储(Application Storage)选项卡:

    这下当前存储状态一目了然了吧~ 当然我也可以在程序中获取这些属性.

                using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication())
                
    {
                    isf.AvailableFreeSpace.ToString() 
    + " bytes";//这里是剩余空间
                    isf.Quota.ToString() + " bytes";//这里是当前的限额
                    (isf.Quota - isf.AvailableFreeSpace).ToString() + " bytes";//这里是用户已经使用的空间
                  }

    好的 现在我们来看看如何更改默认限额吧~

                using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication())
                
    {
                    
    try
                    
    {
                        
    if (true == isf.IncreaseQuotaTo(1048576 * 2))//将限额增加到2MB(注: 这里单位是bytes) 
                        {
                            Results.Text 
    = "限额更改成功.";
                        }

                        
    else
                        
    {
                            Results.Text 
    = "限额更改失败.";
                        }

                    }

                    
    catch (Exception e)
                    
    {
                        System.Windows.Browser.HtmlPage.Window.Alert(e.Message);
                    }

                }

    很简单吧~ 这里有的朋友要可能要问 上次存储我们那些数据放在哪啦

    就此告送大家应该在C:\Users\sonic\AppData\LocalLow\Microsoft\Silverlight\is\gsp5lhdk.hho\ulgnbrmt.oex\1\s\1q1n5d1w2fxymchxxzodpthfoihskwnyxxqcmkokboh55qcc3naaacga\f\sonic.txt

    Source code: IsolatedStorageDEMO2

  • 相关阅读:
    小酌一下:pipenv 基本用法
    sql2008使用您对无法重新创建的表进行了更改或者启用了“阻止保存重新创建表的更改”
    Join操作基本:外连接、自然连接、内连接
    用dataReader获取datetime类型完整精度的时间字串
    c# MesageBox
    判断当前时间是否在一个时间段内
    c# 根据当前时间获取,本周,本月,本季度,月初,月末,各个时间段
    sql Convert函数
    c# MD5方法总结
    wml跳转
  • 原文地址:https://www.cnblogs.com/sonic1abc/p/1246642.html
Copyright © 2011-2022 走看看