ASP ကျူတိုရီရယ်များ

ASP ပင်မစာမျက်နှာ

WP ကျူတိုရီရယ်

ဝဘ်စာမျက်နှာများ နိဒါန်း ဝဘ်စာမျက်နှာများ သင်တုန်းဓား ဝဘ်စာမျက်နှာများ အပြင်အဆင် ဝဘ်စာမျက်နှာများ ဖိုဒါများ WebPages Global ဝဘ်စာမျက်နှာများ ပုံစံများ ဝဘ်စာမျက်နှာများ အရာဝတ္ထုများ WebPages ဖိုင်များ ဝဘ်စာမျက်နှာများ ဒေတာဘေ့စ်များ ဝဘ်စာမျက်နှာများ အကူအညီပေးသူများ ဝဘ်စာမျက်နှာများ WebGrid ဝဘ်စာမျက်နှာများ ဇယားများ ဝဘ်စာမျက်နှာများ အီးမေးလ် ဝဘ်စာမျက်နှာများ လုံခြုံရေး ဝဘ်စာမျက်နှာများ ထုတ်ဝေခြင်း။ ဝဘ်စာမျက်နှာများ ဥပမာများ WebPages အတန်းများ

ASP.NET Razor

သင်တုန်းမိတ်ဆက် Razor Syntax Razor C# Variables Razor C# ကွင်း သင်တုန်း C# ယုတ္တိဗေဒ Razor VB Variables Razor VB Loops Razor VB Logic

ASP Classic

ASP မိတ်ဆက် ASP Syntax ASP Variables ASP လုပ်ထုံးလုပ်နည်းများ ASP အခြေအနေများ ASP Looping ASP ပုံစံများ ASP Cookies ASP Session ASP လျှောက်လွှာ ASP #ပါဝင်ပါသည်။ ASP Global.asa ASP AJAX ASP အီးမေးလ် ASP ဥပမာများ

ASP အကိုးအကား

ASP VB လုပ်ဆောင်ချက်များ ASP VB သော့ချက်စာလုံးများ ASP တုံ့ပြန်မှု ASP တောင်းဆိုချက် ASP လျှောက်လွှာ ASP Session ASP ဆာဗာ ASP အမှား ASP ဖိုင်စနစ် ASP TextStream ASP Drive ASP ဖိုင် ASP Folder ASP အဘိဓာန် ASP AdRotator ASP BrowserCap ASP အကြောင်းအရာ ချိတ်ဆက်ခြင်း။ ASP အကြောင်းအရာ Rotator ASP အမြန် Ref

ADO ကျူတိုရီရယ်

ADO မိတ်ဆက် ADO ချိတ်ဆက်မှု ADO မှတ်တမ်းအစုံ ADO ရုပ်ထွက် ADO မေးခွန်း ADO အမျိုးအစား ADO ထည့်ပါ။ ADO အပ်ဒိတ် ADO ဖျက်ပါ။ ADO ဒီမို ADO အရှိန်မြှင့်ပါ။

ADO အရာဝတ္ထုများ

ADO Command ADO ချိတ်ဆက်မှု ADO အမှား ADO Field ADO Parameter ADO အိမ်ခြံမြေ ADO မှတ်တမ်း ADO မှတ်တမ်းအစုံ ADO တိုက်ရိုက်ကြည့်ရှုခြင်း။ ADO ဒေတာအမျိုးအစားများ

ASP.NET ဝဘ်စာမျက်နှာများ - WebSecurity Object


ဖော်ပြချက်

WebSecurity Object သည် ASP.NET Web Pages အပလီကေးရှင်းများအတွက် လုံခြုံရေးနှင့် စစ်မှန်ကြောင်းအထောက်အထားပြခြင်းကို ပံ့ပိုးပေးပါသည်။

WebSecurity အရာဝတ္ထုဖြင့် သင်သည် အသုံးပြုသူအကောင့်များကို ဖန်တီးခြင်း၊ အကောင့်ဝင်ခြင်းနှင့် ထွက်အသုံးပြုသူများ၊ စကားဝှက်များကို ပြန်လည်သတ်မှတ်ခြင်း သို့မဟုတ် ပြောင်းလဲခြင်းနှင့် အခြားအရာများကို ပြုလုပ်နိုင်သည်။


WebSecurity Object ကိုးကား - Properties

Properties Description
CurrentUserId Gets the ID for the current user
CurrentUserName Gets the name of the current user
HasUserId Returns true if the current has a user ID
IsAuthenticated Returns true if the current user is logged in

WebSecurity Object ရည်ညွှန်းချက် - နည်းလမ်းများ

Method Description
ChangePassword() Changes the password for a user
ConfirmAccount() Confirms an account using a confirmation token
CreateAccount() Creates a new user account
CreateUserAndAccount() Creates a new user account
GeneratePasswordResetToken() Generates a token that can be sent to as user by email
GetCreateDate() Gets the time the specified membership was created
GetPasswordChangeDate() Gets the date and time when password was changed
GetUserId() Gets a user ID from a user name
InitializeDatabaseConnection() Initializes the WebSecurity system (database)
IsConfirmed() Checks if a user is confirmed
IsCurrentUser() Checks if the current user matches a user name
Login() Logs the user in by setting a token in the cookie
Logout() Logs the user out by removing the token cookie
RequireAuthenticatedUser() Exits the page if the user is not an authenticated user
RequireRoles() Exits the page if the user is not a part of the specified roles
RequireUser() Exits the page if the user is not the specified user
ResetPassword() Changes a user's password using a token
UserExists() Checks if a given user exists


WebSecurity Database ကို စတင်ခြင်း

သင့်ကုဒ်တွင် WebSecurity အရာဝတ္တုကို အသုံးမပြုမီတွင် သင်သည် WebSecurity ဒေတာဘေ့စ်တစ်ခုကို ဖန်တီးရန် သို့မဟုတ် အစပြုရပါမည်။

သင့်ဝဘ်၏ အမြစ်တွင် _AppStart.cshtml အမည်ရှိ စာမျက်နှာတစ်ခု ဖန်တီးပါ (သို့မဟုတ် စာမျက်နှာကို တည်းဖြတ်ပါ)

ဖိုင်အတွင်း အောက်ပါကုဒ်ကို ထည့်ပါ။

_AppStart.cshtml

@{
WebSecurity.InitializeDatabaseConnection("Users", "UserProfile", "UserId", "Email", true);
}

ဝဘ်ဆိုက် (အက်ပ်လီကေးရှင်း) စတင်ချိန်တိုင်း အပေါ်ကကုဒ်က အလုပ်လုပ်ပါလိမ့်မယ်။ ၎င်းသည် WebSecurity ဒေတာဘေ့စ်ကို အစပြုသည်။

"အသုံးပြုသူများ" သည် WebSecurity database (Users.sdf) ၏ အမည်ဖြစ်သည်။

"UserProfile" သည် အသုံးပြုသူပရိုဖိုင်အချက်အလက်ပါရှိသော ဒေတာဘေ့စ်ဇယား၏အမည်ဖြစ်သည်။

"UserId" သည် အသုံးပြုသူ ID များ (ပင်မသော့) ပါ၀င်သော ကော်လံအမည်ဖြစ်သည်။

"အီးမေးလ်" သည် အသုံးပြုသူအမည်များပါရှိသော ကော်လံအမည်ဖြစ်သည်။

နောက်ဆုံး ကန့်သတ်ဘောင်မှာ true သည် အသုံးပြုသူပရိုဖိုင်နှင့် အဖွဲ့ဝင်ခြင်းဇယားများ မရှိလျှင် အလိုအလျောက် ဖန်တီးသင့်သည်ဟု ညွှန်ပြသော boolean တန်ဖိုး တစ်ခုဖြစ်သည်

ဒေတာဘေ့စ် ဇယားများ အလိုအလျောက် ဖန်တီးခြင်းကို အမှန် ဟု ညွှန်ပြ သော်လည်း ဒေတာဘေ့စ်ကိုယ်တိုင်က အလိုအလျောက် ဖန်တီးမည်မဟုတ်ပါ။ ရှိကိုရှိရမယ်။


WebSecurity ဒေတာဘေ့စ်

UserProfile ဇယားတွင် သုံးစွဲသူတစ်ဦးစီအတွက် မှတ်တမ်းတစ်ခုပါရှိသည်၊ အသုံးပြုသူ ID (ပင်မသော့) နှင့် အသုံးပြုသူ၏အမည် (အီးမေးလ်) တို့ပါရှိသည်

UserId Email
1 [email protected]
[email protected]
3 [email protected]

အဖွဲ့ဝင်ခြင်းဇယား တွင် အသုံးပြုသူအား ဖန်တီးခဲ့သည့်အချိန်နှင့် (အချိန်နှင့်) အဖွဲ့ဝင်ခြင်းကို အတည်ပြုခြင်းရှိမရှိ စသည့် အဖွဲ့ဝင်အချက်အလက်များ ပါဝင်မည်ဖြစ်သည်။

ဤကဲ့သို့ (အချို့ကော်လံများကို မပြပါ)။

User
Id
Create
Date
Confirmation
Token
Is
Confirmed
Last
Password
Failure
Password Password
Change
1 12.04.2012 16:12:17 NULL True NULL AFNQhWfy.... 12.04.2012 16:12:17

ရိုးရှင်းသော အသင်းဝင်ဖွဲ့စည်းမှုပုံစံ

သင့်ဆိုက်သည် ASP.NET ဝဘ်စာမျက်နှာများအသင်းဝင်စနစ် SimpleMembership ကိုအသုံးပြုရန် ပြုပြင်မွမ်းမံပါက WebSecurity အရာဝတ္ထုကို အသုံးပြု၍ အမှားအယွင်းများ ရရှိနိုင်သည် ။

hosting ဝန်ဆောင်မှုပေးသူ၏ဆာဗာကို သင့်ဒေသခံဆာဗာထက် ကွဲပြားစွာ ပုံစံချထားပါက ၎င်းသည် ဖြစ်ပေါ်နိုင်သည်။ ၎င်းကိုဖြေရှင်းရန်၊ ဝဘ်ဆိုက်၏ Web.config ဖိုင်တွင် အောက်ပါဒြပ်စင်ကို ထည့်ပါ။

<appSettings>
<add key="enableSimpleMembership" value="true" />
</appSettings>