问题描述
我们需要创建一个包含多个UserControls的asp.Net页面,在这里我需要给选项以通过仅允许某些"UserControls"在用户感兴趣的情况下进行显示来配置这些页面.因此,我计划使用"Web部件",ASP.Net中的becoz Web部件提供了我在应用程序中所需的所有选项.
我的问题是如何在DB/XML中存储每个用户的配置信息.
任何人都可以分享有关这些知识.
在此先感谢!!!!!!!!
Hi,
We need to create a asp.Net page which contains a multiple UserControls, where i need to give option to configure these page by allowing only certain "UserControls" to get displayed upon user interest. So i planned of using "WEB PARTS", becoz web parts in ASP.Net provides all the options which i required in my application.
My Question here is how to store each user''s configuration information in DB/XML.
Can anyone please share the knowledge about these.
Thanks in Advance!!!!!!!!
推荐答案
IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User |
IsolatedStorageScope.Assembly | IsolatedStorageScope.Domain, null, null);
IsolatedStoreage提供了多种读取/写入信息的方法.下面的示例代码用于获取IsolatedStoreage的状态.
IsolatedStoreage provides variety of methods to read/write the information. Below sample code is to fetch the status of IsolatedStoreage.
using System.IO.IsolatedStorage;
public static void ShowIsoStoreStatus(TextBlock inputBlock)
{
// Obtain an isolated store for an application.
try
{
using (var store = IsolatedStorageFile.GetUserStoreForApplication())
{
string spaceUsed = (store.Quota - store.AvailableFreeSpace).ToString();
string spaceAvailable = store.AvailableFreeSpace.ToString();
string curQuota = store.Quota.ToString();
inputBlock.Text =
String.Format("Quota: {0} bytes, Used: {1} bytes, Available: {2} bytes",
curQuota, spaceUsed, spaceAvailable);
}
}
catch (IsolatedStorageException)
{
inputBlock.Text = "Unable to access store.";
}
这篇关于如何为每个用户个人用户存储用户配置的WebParts信息.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!