یک مشکل عجيب در وارد کردن پسورد.

zorig4fun

Member
سلام من از ويژوال دات نت ۲۰۰۵ به زبان vb استفاده ميکنم.
مشکل من در asp.net configuratio است که بنا بر ويدئيو اموزشی که دارم و کارها را دنبال ميکنم يک قسمت هست که يوزر عضو ميکنی مشخصات رو وارد ميکنم فقط پسورد را به من خطا ميده و ميگه که پسورد بايد بيش از ۷ تا باشه و از علايم نيز استفاده نشه.
من هرچی فکر کنيد وارد ميکنم ولی همواره اين پيغام رو دريافت ميکنم من فکر کردم مشکل شايد از زبان کيبرد باشه (به صورت ديفلت آلمانی ميباشد) و زبان را تغيير دادم ولی باز با همين مشکل روبرو هستم لطفا راهنمائی کنيد مشکل از کجاست؟
 

amirlol

Well-Known Member
ببینم رمز رو اینطوری وارد کنم
مثلآ dddd3212d باید حتمآ یک کاراکتر توش حروف و عدد باشه




فکر کنم Ok بشه ! خبرم کن
 

zorig4fun

Member
مشکل از اون نيست من امتحان کردم اين پسوردی که شما نوشتيد رو هم امتحان کردم نشد
 

mehranzand

Member
برای اینکار کافیه در فایل Web.Config خاصیت minRequiredNonalphanumericCharacters
پرو وایدر Membership را برابر صفر تنظیم کنی.

<system.web>
<membership>
<providers>
<add name="YourProvider" minRequiredNonalphanumericCharacters="0"/>
</providers>
</membership>

موفق باشی
 

zorig4fun

Member
مرسی از اينکه وقت دادين
من داخل کدهای خودم چنين کدی نديدم ولی با اين وجود اضافه کردم ولی ارور داد.

کدهای اصلی

کد:
<?xml version="1.0"?>
<!-- 
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
    \Windows\Microsoft.Net\Framework\v2.x\Config 
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
	<appSettings/>
	<connectionStrings>
		<clear/>
		<add name="LocalSQLServer" connectionString="Server=HOME\SQLEXPRESS;Database=aspnetdb;Trusted_connection=Yes"/>
	</connectionStrings>
	<system.web>
		<!-- 
            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only 
            during development.

            Visual Basic options:
            Set strict="true" to disallow all data type conversions 
            where data loss can occur. 
            Set explicit="true" to force declaration of all variables.
        -->
  <roleManager enabled="true" />
  <compilation debug="true" strict="false" explicit="true"/>
		<pages>
			<namespaces>
				<clear/>
				<add namespace="System"/>
				<add namespace="System.Collections"/>
				<add namespace="System.Collections.Specialized"/>
				<add namespace="System.Configuration"/>
				<add namespace="System.Text"/>
				<add namespace="System.Text.RegularExpressions"/>
				<add namespace="System.Web"/>
				<add namespace="System.Web.Caching"/>
				<add namespace="System.Web.SessionState"/>
				<add namespace="System.Web.Security"/>
				<add namespace="System.Web.Profile"/>
				<add namespace="System.Web.UI"/>
				<add namespace="System.Web.UI.WebControls"/>
				<add namespace="System.Web.UI.WebControls.WebParts"/>
				<add namespace="System.Web.UI.HtmlControls"/>
			</namespaces>
		</pages>
		<!--
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
        -->
		<authentication mode="Forms"/>
		<!--
            The <customErrors> section enables configuration 
            of what to do if/when an unhandled error occurs 
            during the execution of a request. Specifically, 
            it enables developers to configure html error pages 
            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
	</system.web>
</configuration>

اين دقيقا پيغامی است که در يافت ميکنم.

کد:
Password length minimum: 7. Non-alphanumeric characters required: 1.

حالا کدهی شما رو هم وارد کردم اين پيغام رو ميده درواقع صفحه سکيوريتی اصلا باز نميشه.
کد:
There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store. 

The following message may help in diagnosing the problem: Required attribute 'type' not found. (C:\Documents and Settings\DrZ3D\My Documents\Visual Studio 2005\WebSites\MemProviderSQLVB\web.config line 19)
 

mehranzand

Member
دوست من شما یهتر است برای این کار membership پرو وایدر را دوباره امپلیمنت کنی.
یک نمونه اسکریپت کامل براتون گذاشتم.
کد:
    <membership>
      <providers>
        <remove name="AspNetSqlMembershipProvider"/>
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="mbp" enablePasswordRetrieval="true" enablePasswordReset="true" requiresQuestionAndAnswer="false" applicationName="/" requiresUniqueEmail="true" passwordFormat="Encrypted" maxInvalidPasswordAttempts="5" passwordAttemptWindow="10" passwordStrengthRegularExpression="" minRequiredPasswordLength="4" minRequiredNonalphanumericCharacters="0"/>
      </providers>
    </membership>
 

zorig4fun

Member
مرسی از کدهائی که داديد
من اين کدهای شما را کپی کردم زير <system.web> حالا نميدونم چيزی را يايد اضافه ميکردم يا نه ولی ارور داد

کد:
There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store. 

The following message may help in diagnosing the problem: The connection name 'mbp' was not found in the applications configuration or the connection string is empty. (C:\Documents and Settings\DrZ3D\My Documents\Visual Studio 2005\WebSites\MemProviderSQLVB\web.config line 20)
 

zorig4fun

Member
فقط خواستم بگم که مشکلم حل شد درواقع من اشتباه فهميده بودم بايد در پسورد يک علامت نيز استفاده ميکردم.
افرادی که همين مشکل را داند نيز ميتوانند کدهای زير را به webconfig خودشان اضافه کنند تا اين محدوديت و محدوديت حد اقل حرف را درست کنند.
کد:
    <membership>
      <providers>
        <add name="AspNetSqlMembershipProvider" 
  type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
  connectionStringName="LocalSqlServer" 
  enablePasswordRetrieval="false" 
  enablePasswordReset="true" 
  requiresQuestionAndAnswer="true" 
  applicationName="/" 
  requiresUniqueEmail="false" 
  passwordFormat="Hashed" 
  maxInvalidPasswordAttempts="5" 
  minRequiredPasswordLength="4" <----- Changed to 4 
  minRequiredNonalphanumericCharacters="0"  <----- Changed to 0 
  passwordAttemptWindow="10" 
  passwordStrengthRegularExpression="" />
      </providers>
    </membership>


مرجع حل مشکل در http://forums.asp.net/p/1132358/1798714.aspx#1798714
 

جدیدترین ارسال ها

بالا