介绍
Silverlight 2.0 数据的独立存储(Isolated Storage):
    IsolatedStorageFile - 操作 独立存储 的类
        IsolatedStorageFile.GetUserStoreForSite() - 按站点获取用户的独立存储
        IsolatedStorageFile.GetUserStoreForApplication() - 按应用程序获取用户的独立存储
    IsolatedStorageSettings - 在独立存储中保存的 key-value 字典表
        IsolatedStorageSettings.SiteSettings - 按站点保存的 key-value 字典表
        IsolatedStorageSettings.ApplicationSettings - 按应用程序保存的 key-value 字典表


在线DEMO
http://www.cnblogs.com/webabcd/archive/2008/10/09/1307486.html


示例
IsolatedStorage.xaml
2.0数据之独立存储(Isolated Storage)<UserControl x:Class="Silverlight20.Data.IsolatedStorage"
2.0数据之独立存储(Isolated Storage)    xmlns
="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
2.0数据之独立存储(Isolated Storage)    xmlns:x
="http://schemas.microsoft.com/winfx/2006/xaml">
2.0数据之独立存储(Isolated Storage)    
<StackPanel HorizontalAlignment="Left">
2.0数据之独立存储(Isolated Storage)        
<TextBox x:Name="txtMsg" Margin="5" />
2.0数据之独立存储(Isolated Storage)        
<TextBox x:Name="txtMsg2" Margin="5" />
2.0数据之独立存储(Isolated Storage)        
<Button x:Name="increase" Content="增加配额" Click="increase_Click" Margin="5" />
2.0数据之独立存储(Isolated Storage)    
</StackPanel>
2.0数据之独立存储(Isolated Storage)
</UserControl>
2.0数据之独立存储(Isolated Storage)

IsolatedStorage.xaml.cs
2.0数据之独立存储(Isolated Storage)using System;
2.0数据之独立存储(Isolated Storage)
using System.Collections.Generic;
2.0数据之独立存储(Isolated Storage)
using System.Linq;
2.0数据之独立存储(Isolated Storage)
using System.Net;
2.0数据之独立存储(Isolated Storage)
using System.Windows;
2.0数据之独立存储(Isolated Storage)
using System.Windows.Controls;
2.0数据之独立存储(Isolated Storage)
using System.Windows.Documents;
2.0数据之独立存储(Isolated Storage)
using System.Windows.Input;
2.0数据之独立存储(Isolated Storage)
using System.Windows.Media;
2.0数据之独立存储(Isolated Storage)
using System.Windows.Media.Animation;
2.0数据之独立存储(Isolated Storage)
using System.Windows.Shapes;
2.0数据之独立存储(Isolated Storage)
2.0数据之独立存储(Isolated Storage)
using System.IO.IsolatedStorage;
2.0数据之独立存储(Isolated Storage)
using System.IO;
2.0数据之独立存储(Isolated Storage)
2.0数据之独立存储(Isolated Storage)
namespace Silverlight20.Data

演示 IsolatedStorageFile 的运行结果:
根目录下的目录列表:
Directory01
Directory02
根目录下的文件列表:
RootFile01.txt
__LocalSettings
目录 Directory01 下的目录列表:
SubDirectory01
目录 Directory01/SubDirectory01 下的*.txt文件列表:
File01.txt
File02.txt
文件 File01.txt 的内容:
我是:webabcd
我专注于asp.net, Silverlight
无法删除,目录不为空或不存在。

演示 IsolatedStorageSettings 的运行结果:
value
value2
0

相关文章:

  • 2021-08-23
  • 2021-04-28
  • 2021-07-23
  • 2021-07-05
  • 2022-02-10
  • 2021-10-11
猜你喜欢
  • 2021-05-02
  • 2022-02-10
  • 2021-08-08
  • 2021-05-27
  • 2022-12-23
相关资源
相似解决方案