新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
Silverlight獨立存儲配置相關(guān)操作步驟講解
Silverlight開發(fā)工具中有很多功能可以被我們靈活的利用創(chuàng)造出更多的新穎的功能服務(wù)于大眾。對于這樣的一款多媒體處理工具,其功能是非常強大的。Silverlight獨立存儲配置,在Beta 1時代是應(yīng)用程序配置,現(xiàn)在不僅支持應(yīng)用程序配置,同時還支持站點配置,我們可以用它來存儲應(yīng)用程序配置如每個頁面顯示的圖片數(shù)量,頁面布局自定義配置等等,使用IsolatedStorageSettings類來實現(xiàn),該類在設(shè)計時使用了字典來存儲名-值對,它的使用相當簡單:#t#

- IsolatedStorageSettings appSettings =
IsolatedStorageSettings.ApplicationSettings; - appSettings.Add("mykey","myValue");
- appSettings.Save();
- IsolatedStorageSettings siteSettings =
- IsolatedStorageSettings.SiteSettings;
- siteSettings.Add("mykey1","myValue1");
- siteSettings.Save();
Silverlight獨立存儲配置的機制也是基于本地文件存儲,系統(tǒng)默認的會創(chuàng)建一個名為__LocalSettings的文件進行存儲。
打開文件后可以看到,存儲的內(nèi)容(此處進行了整理)
- < ArrayOfKeyValueOfstringanyType
- xmlns:i="http://www.w3.org/2001
/XMLSchema-instance"- xmlns="http://schemas.microsoft
.com/2003/10/Serialization/Arrays">- < KeyValueOfstringanyType>
- < Key>mykey< /Key>
- < Value xmlns:d3p1="http://
www.w3.org/2001/XMLSchema"- i:type="d3p1:string">myValue< /Value>
- < /KeyValueOfstringanyType>
- < /ArrayOfKeyValueOfstringanyType>
值得一提的是使用Silverlight獨立存儲配置不僅僅可以存儲簡單類型的數(shù)據(jù),也可以存儲我們自定義類型的數(shù)據(jù)。
當前題目:Silverlight獨立存儲配置相關(guān)操作步驟講解
鏈接分享:http://fisionsoft.com.cn/article/djjhjsj.html


咨詢
建站咨詢
