Latest web development tutorials
×

ASP.NET หลักสูตร

ASP.NET หลักสูตร ASP.NET แนะนำโดยย่อ

WP หลักสูตร

WebPages แนะนำโดยย่อ WebPages Razor WebPages แบบ WebPages โฟลเดอร์ WebPages สถานการณ์โดยรวม WebPages ฟอร์ม WebPages วัตถุ WebPages ไฟล์ WebPages ผู้ช่วย WebPages WebGrid WebPages แผนภูมิ WebPages Email WebPages PHP WebPages ปล่อย WebPages ตัวอย่าง

WP คู่มืออ้างอิง

WebPages หมวดหมู่ WebPages ความปลอดภัย WebPages ฐานข้อมูล WebPages ไปรษณีย์ WebPages ผู้ช่วย

ASP.NET Razor

Razor แนะนำโดยย่อ Razor ไวยากรณ์ Razor C# ตัวแปร Razor C# การไหลเวียน Razor C# ตรรกะ Razor VB ตัวแปร Razor VB การไหลเวียน Razor VB ตรรกะ

ASP.NET MVC

MVC แนะนำโดยย่อ MVC การประยุกต์ใช้งาน MVC โฟลเดอร์ MVC แบบ MVC ตัวควบคุม MVC ดู MVC ฐานข้อมูล MVC แบบ MVC ความปลอดภัย MVC HTML ผู้ช่วย MVC ปล่อย MVC คู่มืออ้างอิง

WF หลักสูตร

WebForms แนะนำโดยย่อ WebForms หน้า WebForms การควบคุม WebForms เหตุการณ์ WebForms ฟอร์ม WebForms ViewState WebForms TextBox WebForms Button WebForms ข้อมูลผูกพัน WebForms ArrayList WebForms Hashtable WebForms SortedList WebForms XML ไฟล์ WebForms Repeater WebForms DataList WebForms เชื่อมต่อฐานข้อมูล WebForms หน้าเว็บมาสเตอร์ WebForms การเดินเรือ WebForms ตัวอย่าง

WF คู่มืออ้างอิง

WebForms HTML WebForms Controls WebForms Validation

ASP.NET MVC การรักษาความปลอดภัย

เพื่อเรียนรู้ ASP.NET MVC เราจะสร้างใช้งานอินเทอร์เน็ต

ส่วนที่ 8: การเพิ่มการรักษาความปลอดภัย


MVC Application Security

โฟลเดอร์รุ่นมีระดับหมายถึงการประยุกต์ใช้แบบจำลอง

Visual Web Developer จะสร้างไฟล์ AccountModels.cs ที่มีรูปแบบการประยุกต์ใช้สำหรับการตรวจสอบ

AccountModels มี LogOnModel, ChangePasswordModel และ RegisterModel:

แบบ


เปลี่ยนรหัสผ่านรุ่น

public class ChangePasswordModel
{

[Required]
[DataType(DataType.Password)]
[Display(Name = "Current password")]
public string OldPassword { get; set; }

[Required]
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
[DataType(DataType.Password)]
[Display(Name = "New password")]
public string NewPassword { get; set; }

[DataType(DataType.Password)]
[Display(Name = "Confirm new password")]
[Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
public string ConfirmPassword { get; set; }

}


รูปแบบการเข้าสู่ระบบ

public class LogOnModel
{

[Required]
[Display(Name = "User name")]
public string UserName { get; set; }

[Required]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }

[Display(Name = "Remember me?")]
public bool RememberMe { get; set; }

}


สมาชิกรุ่น

public class RegisterModel
{

[Required]
[Display(Name = "User name")]
public string UserName { get; set; }

[Required]
[DataType(DataType.EmailAddress)]
[Display(Name = "Email address")]
public string Email { get; set; }

[Required]
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }

[DataType(DataType.Password)]
[Display(Name = "Confirm password")]
[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
public string ConfirmPassword { get; set; }

}