ASP.Net 中 web.config 文件中成员资格提供程序类型中的 Culture 和 PublicKeyToken 是什么?
我正在阅读《ASP.NET MVC 1.0 网站编程》一书,以下内容包含在示例项目的 web.config 文件中:
<authentication mode="Forms">
<forms defaultUrl="/" loginUrl="/user/login" />
</authentication>
<membership>
<providers>
<clear />
<add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="TheBeerHouseConnectionString"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
applicationName="TheBeerHouse"
requiresUniqueEmail="true"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="5"
passwordAttemptWindow="10"
passwordStrengthRegularExpression=""
/>
</providers>
</membership>
我了解除 Culture
和 PublicKeyToken
decleratinos 包含在 Membership / Providers / Add / Type
中
有人可以帮助我理解这两个方面吗?
I am reading through the book ASP.NET MVC 1.0 Website Programming and the following is contained within the web.config file in the example project:
<authentication mode="Forms">
<forms defaultUrl="/" loginUrl="/user/login" />
</authentication>
<membership>
<providers>
<clear />
<add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="TheBeerHouseConnectionString"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
applicationName="TheBeerHouse"
requiresUniqueEmail="true"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="5"
passwordAttemptWindow="10"
passwordStrengthRegularExpression=""
/>
</providers>
</membership>
I understand everything minus the Culture
and PublicKeyToken
decleratinos contained within Membership / Providers / Add / Type
Could anyone help me to understand these two aspects?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在“类型”字段中,您基本上指定了将实现成员身份提供程序的 .net 类型以及包含它的程序集。
关于您询问的特定元素:
文化参数:用于指定程序集/类型的本地化版本。通常这只是“中性”。
PublicKeyToken:当引用具有此类标识符字符串的程序集时,PublicKeyToken 是与签名程序集 (dll) 相关的公钥的哈希值。在本例中,我假设它是 system.web 程序集的 PublicKeyToken。
In the 'type' field you are basically specifying the .net type which will impliment the membership provider, and the assembly which contains it.
Regarding the specific elements you are asking about:
Culture parameter: is used to specify localised versions of the assembly/type. Usually this is just 'neutral'.
PublicKeyToken: When refering to an assembly with this kind of identifier string, the PublicKeyToken is a hash of the public key related to the signed assembly (dll). In this case I assume it is the PublicKeyToken of the system.web assembly.