[索引页]
[源码下载]
作者: webabcd
介绍
Silverlight 2.0 数据的独立存储(Isolated Storage):
IsolatedStorageFile - 操作 独立存储 的类
IsolatedStorageFile.GetUserStoreForSite() - 按站点获取用户的独立存储
IsolatedStorageFile.GetUserStoreForApplication() - 按应用程序获取用户的独立存储
IsolatedStorageSettings - 在独立存储中保存的 key-value 字典表
IsolatedStorageSettings.SiteSettings - 按站点保存的 key-value 字典表
IsolatedStorageSettings.ApplicationSettings - 按应用程序保存的 key-value 字典表
在线DEMO
http://www.voidcn.com/article/p-ounmxjds-tq.html
示例
IsolatedStorage.xaml
[源码下载]
稳扎稳打Silverlight(16) - 2.0数据之独立存储(Isolated Storage)
作者: webabcd
介绍
Silverlight 2.0 数据的独立存储(Isolated Storage):
IsolatedStorageFile - 操作 独立存储 的类
IsolatedStorageFile.GetUserStoreForSite() - 按站点获取用户的独立存储
IsolatedStorageFile.GetUserStoreForApplication() - 按应用程序获取用户的独立存储
IsolatedStorageSettings - 在独立存储中保存的 key-value 字典表
IsolatedStorageSettings.SiteSettings - 按站点保存的 key-value 字典表
IsolatedStorageSettings.ApplicationSettings - 按应用程序保存的 key-value 字典表
在线DEMO
http://www.voidcn.com/article/p-ounmxjds-tq.html
示例
IsolatedStorage.xaml
<UserControl x:Class="Silverlight20.Data.IsolatedStorage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel HorizontalAlignment="Left">
<TextBox x:Name="txtMsg" Margin="5" />
<TextBox x:Name="txtMsg2" Margin="5" />
<Button x:Name="increase" Content="增加配额" Click="increase_Click" Margin="5" />
</StackPanel>
</UserControl>
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel HorizontalAlignment="Left">
<TextBox x:Name="txtMsg" Margin="5" />
<TextBox x:Name="txtMsg2" Margin="5" />
<Button x:Name="increase" Content="增加配额" Click="increase_Click" Margin="5" />
</StackPanel>
</UserControl>
IsolatedStorage.xaml.cs
演示 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
OK
[源码下载]
根目录下的目录列表:
Directory01
Directory02
根目录下的文件列表:
RootFile01.txt
__LocalSettings
目录 Directory01 下的目录列表:
subdirectory01
目录 Directory01/subdirectory01 下的*.txt文件列表:
File01.txt
File02.txt
文件 File01.txt 的内容:
我是:webabcd
我专注于asp.net,Silverlight
无法删除,目录不为空或不存在。
演示 IsolatedStorageSettings 的运行结果:
value
value2
0
OK
[源码下载]
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。