惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cloudbric
Cloudbric
E
Exploit-DB.com RSS Feed
SecWiki News
SecWiki News
Forbes - Security
Forbes - Security
N
News | PayPal Newsroom
S
Security @ Cisco Blogs
Schneier on Security
Schneier on Security
V
V2EX - 技术
S
Secure Thoughts
W
WeLiveSecurity
Google DeepMind News
Google DeepMind News
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
S
Securelist
S
Security Archives - TechRepublic
Know Your Adversary
Know Your Adversary
V
Vulnerabilities – Threatpost
Security Latest
Security Latest
Recent Commits to openclaw:main
Recent Commits to openclaw:main
G
GRAHAM CLULEY
H
Hacker News: Front Page
Microsoft Azure Blog
Microsoft Azure Blog
I
Intezer
Google Online Security Blog
Google Online Security Blog
美团技术团队
阮一峰的网络日志
阮一峰的网络日志
T
The Exploit Database - CXSecurity.com
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Webroot Blog
Webroot Blog
Jina AI
Jina AI
Engineering at Meta
Engineering at Meta
P
Proofpoint News Feed
The Cloudflare Blog
I
InfoQ
L
LangChain Blog
U
Unit 42
P
Proofpoint News Feed
S
Schneier on Security
S
Security Affairs
Y
Y Combinator Blog
T
Tenable Blog
N
News and Events Feed by Topic
MyScale Blog
MyScale Blog
量子位
Google DeepMind News
Google DeepMind News
Cyberwarzone
Cyberwarzone
博客园 - 聂微东
D
Darknet – Hacking Tools, Hacker News & Cyber Security
GbyAI
GbyAI
AWS News Blog
AWS News Blog

博客园 - wangyan

[转]程序员需要具备的基本技能 LumaQQ.NET For Visual Studio 2005 代码下载 [转]今天你多态了吗? [转]理解C#值类型与引用类型 C#抽象工厂模式的几种实现方法及比较 在C#中使用钩子:按下Alt+F4时使窗口最小化 ASPNETDB 存储过程(4) 个性化用户配置部分 ASPNETDB 存储过程(3) 角色管理部分 ASPNETDB 存储过程(2) 成员资格管理部分 ASPNETDB 存储过程(1) 基本及杂类 ASPNETDB 表和视图(2) 用户成员资格和角色管理 表 ASPNETDB 数据库关系图、表和视图(1) 基本表和独立表 更改login控件对密码安全性的要求 - wangyan 加密解密、信息摘要 Web网站开发设计中常用的技巧 统计在线用户列表 for .net WebForm ASP.NET中怎样实现在线人数的显示 ASP.NET在线用户列表精确版——解决用户意外退出在线列表无法及时更新问题 软件架构师之路
ASPNETDB 表和视图(3) 个性化用户配置、页面个性化设置 表 和视图
wangyan · 2007-12-05 · via 博客园 - wangyan

个性化用户配置(用户自定义属性)表

由此表结构可以看出,所有的用户自定义属性最后都是“打包”(序列化)成一个或两个数据块,
存放在PropertyValuesString(序列化为string、Xml) 和(或) PropertyValuesBinary(序列化为Binary)
两个(或其中之一)字段中,因此要求用户自定义属性必须支持序列化。

序列化方式可由web.config中的serializeAs指定,SqlProfileProvider默认序列化方式为String。

例如用户在web.config中配置了如下自定义属性,这里的serializeAs="String" 仅仅为了表示
可以用户可以自行指定序列化方式,谢不写是一个样的:

<system.web>
  ...
  <connectionStrings>
    <add name="SqlSrvConnectionString" connectionString="..."/>
  </connectionStrings>
  ...
  <profile defaultProvider="SqlSrvProfileProvider">
     <providers>
       ...
         </providers>
    <properties>
         <add name="ThemeName" type="System.String"  serializeAs="String" />
         <group name="addPersonalInfo">
             <add name="FirstName" type="System.String"  serializeAs="String" />
             <add name="LastName" type="System.String" serializeAs="String"  />
            <add name="Birthday" type="System.DateTime" serializeAs="String" />
         </group>
      </properties>
  </profile>
  ...
</system.web> 

并运行了aspx页面中的以下C#代码:

this.Profile.ThemeName = "Blue";
this.Profile.PersonalInfo.FirstName = "John";
this.Profile.PersonalInfo.LastName = "Smith";
this.Profile.PersonalInfo.Birthday = new DateTime(1970, 11, 22);

然后打开数据库中的aspnet_Profile查看表,两个字段的内容分别为:
PropertyNames:        "PersonalInfo.FirstName:S:0:4:PersonalInfo.Birthday:S:4:81:PersonalInfo.LastName:S:85:5:ThemeName:S:90:4:"
PropertyValuesString:"John

1970-11-22T00:00:00SmithBlue"

注:以后在实现自定义用户配置提供程序(ProfileProvider) 一文中我会更详尽地讨论。

有关页面个性化设置的3个表

关系图

页面路径(地址)表

处于共享范围(Shared Scope)的页面个性化设置表

处于单用户范围(User Scope)的页面个性化设置表

视图

  1. aspnet_Applications表的全表视图。

    vw_aspnet_Applications

  2. aspnet_Membership表与aspnet_Users表的关联视图

    vw_aspnet_MembershipUsers

  3. 返回aspnet_Profiles表的用户ID、上次修改时间
    和属性名称串、字符串属性值、二进制属性值的总长度

    vw_aspnet_Profiles

  4. aspnet_Roles表的全表视图。

    vw_aspnet_Roles

  5. aspnet_Users表的全表视图。

    vw_aspnet_Users

  6. aspnet_UsersInRoles表的全表视图。

    vw_aspnet_UsersInRoles

  7. aspnet_Paths表的全表视图。

    vw_aspnet_WebPartState_Paths

  8. 返回aspnet_PersonalizationAllUsers表的页面路径ID、
    以二进制形式保存的页面配置属性的长度和上次修改时间。

    vw_aspnet_WebPartState_Shared

  9. 返回aspnet_WebPartState_User表的页面路径ID、用户ID、
    以二进制形式保存的页面配置属性的长度和上次修改时间。

    vw_aspnet_WebPartState_User