如何为每个用户个人用户存储用户配置的WebParts信息. [英] How to store user configured WebParts infromation for each user individual user.

查看:131
本文介绍了如何为每个用户个人用户存储用户配置的WebParts信息.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我们需要创建一个包含多个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!!!!!!!!

推荐答案

IsolatedStorage是您的业务场景的解决方案.隔离存储是一种数据存储机制,它通过定义将代码与保存的数据相关联的标准化方式来提供隔离和安全性. Itz按用户,应用程序/程序集和域分类,itz编码为:
IsolatedStorage is the solution for your business scenario. Isolated storage is a data storage mechanism that provides isolation and safety by defining standardized ways of associating code with saved data. Itz categorized via user, application/assembly and domain and itz coded as:
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信息.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆