当我在web.config中设置passwordStrengthRegularExpression属性时,为什么会出现错误? [英] Why the error is coming when i am setting the passwordStrengthRegularExpression attribute in web.config?

查看:89
本文介绍了当我在web.config中设置passwordStrengthRegularExpression属性时,为什么会出现错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在we.config中设置passwordStrengthRegularExpression属性,但它显示的错误如下:

I am setting the passwordStrengthRegularExpression attribute in we.config but it is showing the errors as following what is the problem here?

passwordStrengthRegularExpression=" @"(?=.{6,})(?=(.*d){1,})(?=(.*W){1,})" 




XML名称开头的字符.'',十六进制值无效.
XML名称开头的字符"{"(十六进制值)是非法的.
XML名称开头的字符"6"(十六进制值)是非法的.
XML名称开头的字符}"(十六进制值)是非法的.

.
.
.
.
.
如此之多的错误将如何设置此属性的值.....




The character ''.'', hexadecimal value is illegal at the beginning of an XML name.
The character ''{'', hexadecimal value is illegal at the beginning of an XML name.
The character ''6'', hexadecimal value is illegal at the beginning of an XML name.
The character ''}'', hexadecimal value is illegal at the beginning of an XML name.

.
.
.
.
.
So many errors are coming how can i set the value for this attribute.....

推荐答案

这很好....

This is working fine....

passwordStrengthRegularExpression="@(?=.{6,})(?=(.*d){1,})(?=(.*W){1,})"



试试这个:
Hi,
Try this:
<membership defaultProvider="SqlProvider"

  userIsOnlineTimeWindow = "20">
  <providers>
    <add

      name="SqlProvider"

      type="System.Web.Security.SqlMembershipProvider"

      connectionStringName="SqlServices"

      requiresQuestionAndAnswer="true"

      passwordStrengthRegularExpression=" @\"(?=.{6,})(?=(.*\d){1,})(?=(.*\W){1,})"

      />
   </providers>
</membership>


您缺少"\" .


--Amit


You are missing a "\".


--Amit


让我尝试我的答案作为解决方案.

问题是@后面的引号.
Let me try my answer as solution.

The problem was the quote after @.
passwordStrengthRegularExpression="@(?=.{6,})(?=(.*d){1,})(?=(.*W){1,})"



问候

-----
如果您在评论中说过对您有帮助,请标记为解决方案,以帮助其他开发人员=)



Regards

-----
Please, mark as solution if you find useful as you said in the comments to help another developers =)


这篇关于当我在web.config中设置passwordStrengthRegularExpression属性时,为什么会出现错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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