在应用程序的生命周期中存储需要存在的对象的最佳方法是什么?

时间:2010-12-30 15:40:30

标签: silverlight-4.0

在ASP.Net中,我会使用Session状态来存储对象。我将在哪里存储SilverLight中所需的对象。

1 个答案:

答案 0 :(得分:0)

如果您不想在客户端存储信息,可以使用隔离存储。

例如:

// Create an instance of IsolatedStorageSettings. 
private IsolatedStorageSettings userSettings = IsolatedStorageSettings.ApplicationSettings; 
// Add a key and its value. 
userSettings.Add("userImage", "BlueHills.jpg"); 
// Remove the setting. 
userSettings.Remove("userImage"); 

看这里可以让你入门:http://www.silverlight.net/learn/quickstarts/isolatedstorage/

相关问题