(Luận văn tốt nghiệp) xây dựng ứng dụng website học tập online bằng asp net core

224 4 0
(Luận văn tốt nghiệp) xây dựng ứng dụng website học tập online bằng asp net core

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

TRƯỜNG ĐẠI HỌC BÀ RỊA – VŨNG TÀU Khoa Công nghệ kỹ thuật - Nông nghiệp công nghệ cao - - BÁO CÁO ĐỒ ÁN TỐT NGHIỆP Xây dựng ứng dụng Website học tập online ASP.Net Core Trình độ đào tạo : Đại học Ngành : Cơng nghệ thơng tin Chun ngành : Lập trình ứng dụng di động game Khóa học : 2017-2021 Lớp : DH17LT Sinh viên : Nguyễn Hoàng Thiên Ân GVHD : TS.Phan Ngọc Hoàng BÀ RỊA - VŨNG TÀU, NĂM 2021 Luan van Lời cảm ơn Em xin gửi lời cảm ơn chân thành tri ân sâu sắc thầy cô trường Đại học Bà Rịa- Vũng Tàu, đặc biệt thầy cô khoa Công nghệ kỹ thuật - Nông nghiệp công nghệ cao trường tạo điều kiện cho em làm đồ án tốt nghiệp Và em xin chân thành cảm ơn giảng viên TS.Phan Nhật Hoàng nhiệt tình hướng dẫn hướng dẫn em hồn thành đồ án Trong q trình làm đồ án, khó tránh khỏi sai sót, mong thầy, bỏ qua Đồng thời trình độ lý luận kinh nghiệm thực tiễn cịn hạn chế nên báo cáo khơng thể tránh khỏi thiếu sót, em mong nhận ý kiến đóng góp thầy, để em học thêm nhiều kinh nghiệm hoàn thành tốt Em xin chân thành cảm ơn! Luan van NHẬN XÉT CỦA GIÁO VIÊN HƯỚNG DẪN Ngày tháng năm GIÁO VIÊN HƯỚNG DẪN (Ký ghi rõ họ tên) Luan van Lý chọn đề tài Trong thời đại công nghiệp 4.0 - thời đại hệ thống vật lý không gian mạng internet Nghĩa vật, việc liên quan đến công nghệ thông tin Thời đại công nghiệp 4.0 giúp cho việc tiện lợi thông qua internet, điều giúp cho người tiết kiệm thời gian lại Hiện giới nói chung Việt Nam nói riêng, xuất nhiều website học tập trực tuyến Ở đó, người dùng đăng ký, học khóa học trực tuyến mà khơng bị phụ thuộc q nhiều đến thời gian khóa học Họ học lúc họ muốn miễn giảng cịn tồn hệ thống Hình thức học trực tuyến ngày người hưởng ứng lớn, thời đại cơng nghiệp số hóa Để đáp ứng yêu cầu website học tập trực tuyến cần phải đáp ứng nhiều yếu tố liệu lưu trữ, giao diện bắt mắt, dễ sử dụng, … Nắm bắt xu nay, em định chọn đề tài “Xây dựng webíte học tập trực tuyến Asp.net Core” để làm đề tài cho đồ án tốt nghiệp em Em thấy Asp.net Core mã nguồn web tốt với C# giúp em việc đa tảng Và Asp.net đứa Microsoft nên hậu thuẫn mạnh mẽ từ plugin Microsoft Sql server Đó lý em chọn đề tài mã nguồn để làm báo cáo cho đồ án tốt nghiệp cảu em Luan van Mục lục CHƯƠNG NGÔN NGỮ C# 1.1 GIỚI THIỆU VỀ NGÔN NGỮ LẬP TRÌNH C# 1.2 ĐẶC TRƯNG CỦA NGƠN NGỮ LẬP TRÌNH C# 1.2.1 C# ngôn ngữ đơn giản 1.2.2 C# ngôn ngữ đại 1.2.3 C# ngơn ngữ lập trình hướng đối tượng 1.2.4 C# ngơn ngữ từ khóa 1.3 CÁC ƯU ĐIỂM CỦA NGƠN NGỮ LẬP TRÌNH C# 1.4 ỨNG DỤNG CỦA NGÔN NGỮ LẬP TRÌNH C# 1.4.1 Ứng dụng Windows 1.4.2 Ứng dụng Web CHƯƠNG NỀN TẢNG NET .10 2.1 GIỚI THIỆU VỀ NET 10 2.2 CÁC CÔNG NGHỆ NET CHO PHÁT TRIỂN ỨNG DỤNG 10 2.2.1 Công nghệ dựa NET Framework: 10 2.2.2 Công nghệ phát triển ứng dụng mobile: 11 2.2.3 Công nghệ dựa NET Core: 11 2.3 CÁC NỀN TẢNG CÔNG NGHỆ NET 11 2.3.1 .NET Framework 11 2.3.2 .NET Core 11 CHƯƠNG XÂY DỰNG WEBSITE BẰNG ASP.NET CORE 12 3.1 YÊU CẦU ĐẶT RA 12 3.2 PHÂN TÍCH THIẾT KẾ HỆ THỐNG 12 3.2.1 Các đối tượng có Website 12 3.2.2 Các chức hệ thống 12 3.3 PHÂN TÍCH THIẾT KẾ HỆ THỐNG 14 3.4 ĐẶC TẢ USE-CASE 19 3.4.1 Đăng nhập 19 3.4.2 Đăng xuất 20 3.4.3 Đăng ký 21 3.4.4 Xem tồn khóa học 22 3.4.5 Xem tổng hợp giảng khóa học 23 3.4.6 Đăng ký khóa học 24 3.4.7 Xem danh mục khóa học đăng ký 25 3.4.8 Hủy đăng ký khóa học 26 3.4.9 Xem giảng 27 3.4.10 Download giảng 28 3.4.11 Phản hồi giảng cho người quản trị 29 3.4.12 Xem thông tin cá nhân 30 3.4.13 Chỉnh sửa thông tin người dùng 31 3.4.14 Người dùng đổi mật 32 3.4.15 Thêm khóa học 33 3.4.16 Đăng xuất khỏi hệ thống 34 Luan van 3.4.17 Cập nhật (chỉnh sửa) thơng tin khóa học 35 3.4.18 Thêm giảng 36 3.4.19 Chỉnh sửa (cập nhật) giảng 37 3.4.20 Xóa giảng 38 3.4.21 Tổng hợp người dùng 39 3.4.22 Xem tổng hợp phản hồi 40 3.4.23 Phân loại phản hồi 41 3.4.24 Xem phản hồi 42 3.4.25 Xác nhận phản hồi 43 3.4.26 Hoàn thành phản hồi 44 3.4.27 Xóa phản hồi 45 3.4.28 Tổng hợp giảng 46 3.4.29 Reset mật khẩu/ Quên mật 47 3.4.30 Tìm kiếm khóa học/ giảng 48 3.5 XÂY DỰNG CƠ SỞ DỮ LIỆU 48 3.5.1 Các lớp đối tượng có CSDL 48 3.5.2 Mơ hình quan hệ 53 3.6 KẾT QUẢ 54 3.6.1 Các chức User (Người dùng chưa đăng nhập) 54 3.6.2 Các chức User (Người dùng đăng nhập) 60 3.6.3 Các chức Admin 71 3.6.4 Giao diện báo lỗi 78 CHƯƠNG KẾT LUẬN 79 4.1 4.2 KẾT QUẢ ĐẠT ĐƯỢC 79 HƯỚNG PHÁT TRIỂN 79 CHƯƠNG TÀI LIỆU THAM KHẢO 80 CHƯƠNG PHỤ LỤC .81 6.1 CODE XỬ LÝ 81 6.1.1 File AdminController.cs 81 6.1.2 File LessonsController.cs 84 6.1.3 File CoursesController.cs 106 6.1.4 File ReportController.cs 129 6.1.5 File UsersController.cs 143 6.1.6 File HomeController.cs 155 6.1.7 File AdminResponsoitory.cs 166 6.1.8 File Courses_Responsitory.cs 168 6.1.9 File Lessons_Responsitory 174 6.1.10 File Report_Responsitory.cs 182 6.1.11 File Users_Responsitory.cs 189 6.1.12 File SeandEmail.cs 195 6.1.13 File Session_.cs 200 6.1.14 File Admin_Model.cs 203 6.1.15 File Courses_Model 204 6.1.16 File CoursesViewModel.cs 206 6.1.17 File ErrorViewModel.cs 206 Luan van 6.1.18 File Lessons_Model.cs 207 6.1.19 File LessonViewModel.cs 209 6.1.20 File RawCourse_Model.cs 210 6.1.21 File ReportModel.cs 212 6.1.22 File ReportViewModel.cs 212 6.1.23 File StatusReport.cs 214 6.1.24 File Users_Courses_Model.cs 214 6.1.25 File Users_Model.cs 215 6.1.26 File Users_Report.cs 217 6.2 SƠ ĐỒ CẤU TRÚC 218 6.2.1 Xây dựng website bán hàng Asp.net Core 218 6.2.2 Thư mục wwwroot 218 6.2.3 Thư mục Areas 218 6.2.4 Thư mục Controllers 219 6.2.5 Thư mục View 219 6.2.6 Thư mục Migration 220 6.2.7 Thư mục Models 220 6.2.8 Thư mục Services 221 6.3 CÁC EXTEND SỬ DỤNG TRONG WEBSITE 221 6.3.1 Mailkit 221 6.3.2 AspNetCore.Session 223 Luan van Đồ án tốt nghiệp khóa 2017-2021 Trường Đại học Bà Rịa- Vũng Tàu Chương Ngôn ngữ C# 1.1 Giới thiệu ngơn ngữ lập trình C# C# ngơn ngữ lập trình hướng đối tượng phát triển Tập đồn Microsoft Nó thực hầu hết tính chất tốt mơ hình hướng đối tượng giống ngơn ngữ lập trình Java C# ngôn ngữ Microsoft phát triển dựa ngơn ngữ huyền thoại C++ Java C# làm việc chủ yếu khung NET (.NET framework) Ngơn ngữ lập trình có khả tạo nhiều ứng dụng mạnh mẽ an toàn cho tảng Windows Các thành phần máy chủ, dịch vụ web, ứng dụng di động nhiều khả khác 1.2 Đặc trưng ngơn ngữ lập trình C# 1.2.1 C# ngôn ngữ đơn giản C# loại bỏ vài phức tạp rối rắm ngôn ngữ Java c++, bao gồm việc loại bỏ macro, template, đa kế thừa, lớp sở ảo (virtual base class) 1.2.2 C# ngôn ngữ đại Những đặc tính xử lý ngoại lệ, thu gom nhớ tự động, kiểu liệu mở rộng, bảo mật mã nguồn đặc tính mong đợi ngơn ngữ đại C# chứa tất đặc tính 1.2.3 C# ngơn ngữ lập trình hướng đối tượng Lập trình hướng đối tượng (OOP: Object-oriented programming) phương pháp lập trình có tính chất Đó tính trừu tượng (abstraction), tính đóng gói (encapsulation), tính đa hình (polymorphism) tính kế thừa (inheritance) C# hỗ trợ cho tất đặc tính 1.2.4 C# ngơn ngữ từ khóa C# ngôn ngữ sử dụng giới hạn từ khóa Phần lớn từ khóa sử dụng để mô tả thông tin Một số ưu điểm bật khác C# • C# có cấu trúc gần gũi với ngơn ngữ lập trình truyền thống, nên dễ dàng tiếp cận học nhanh với C# • C# biên dịch nhiều tảng máy tính khác • C# xây dựng tảng C++ Java nên thừa hưởng ưu điểm ngơn ngữ SVTH: NGUYỄN HOÀNG THIÊN ÂN Luan van Đồ án tốt nghiệp khóa 2017-2021 Trường Đại học Bà Rịa- Vũng Tàu • C# phần NET Framework nên chống lưng lớn đến từ phận • C# có IDE Visual Studio nhiều plug-in vơ mạnh mẽ 1.3 Các ưu điểm ngôn ngữ lập trình C# • C# ngơn ngữ gần gũi với ngơn ngữ lập trình thơng dụng C++, Java hay Pascal • C # hỗ trợ cộng đồng nhà phát triển lớn • C# sử dụng để tạo hầu hết ứng dụng 1.4 Ứng dụng ngôn ngữ lập trình C# 1.4.1 Ứng dụng Windows Với hỗ trợ khung NET, C# sử dụng để xây dựng ứng dụng desktop Nhiều ứng dụng phổ biến tham khảo Microsoft Office, Skype, Photoshop hay Visual Studio Hình1-1 Ngơn ngữ lập trình C# 1.4.2 Ứng dụng Web Ngoài việc xây dựng ứng dụng Windows, C# cịn có khả tạo nhiều ứng dụng web cách sử dụng asp.net C# làm cho ứng dụng web chạy trơn tru máy chủ SVTH: NGUYỄN HOÀNG THIÊN ÂN Luan van Đồ án tốt nghiệp khóa 2017-2021 Trường Đại học Bà Rịa- Vũng Tàu Chương Nền tảng NET 2.1 Giới thiệu NET NET tảng (framework) cho phép ngơn ngữ lập trình khác sử dụng để xây dựng ứng dụng phát triển Microsoft Đây tảng thực thi ứng dụng phát triển web chủ yếu hệ điều hành Microsoft Windows Hình 2.1-1 Net Cốt lõi tảng NET dịng code viết sẵn (bởi lập trình viên Microsoft) mà lập trình viên sử dụng để tạo phần mềm cách nhanh chóng Do đó, tảng NET xem cơng cụ bổ sung giúp tiết kiệm thời gian xây dựng, triển khai chạy ứng dụng dịch vụ Web 2.2 Các công nghệ NET cho phát triển ứng dụng 2.2.1 Cơng nghệ dựa NET Framework: • Phát triển ứng dụng cho Windows desktop: Windows Forms, Windows Presentation Foundation (WPF), Universal Windows Platform (UWP) • Phát triển ứng dụng web: Active Server Page for NET (ASP.NET), bao gồm ASP.NET MVC, ASP.NET Web Forms, ASP.NET WebPages, SignalR • Phát triển ứng dụng phân tán, ứng dụng hướng dịch vụ: Windows Communications Foundation, ASP.NET Web API, ASP.NET Core • Hỗ trợ làm việc với CSDL: ActiveX Data Object for NET (ADO.NET) • Sharepoint SVTH: NGUYỄN HỒNG THIÊN ÂN Luan van 10 (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core Đồ án tốt nghiệp khóa 2017-2021 Trường Đại học Bà Rịa- Vũng Tàu [Required(ErrorMessage = "Bài giảng không bỏ trống")] [Display(Name = "File giảng")] [DataType(DataType.Upload)] public IFormFile FileLesson { get; set; } [Required(ErrorMessage = "Thumbnail không bỏ trống")] [Display(Name = "Thumbnail giảng")] [DataType(DataType.Upload)] public IFormFile Thumbnail { get; set; } [Required(ErrorMessage = "Link video giảng không bỏ trống")] [Display(Name = "Link video giảng")] [StringLength(100)] public string URL_Videos { get; set; } public string NameImage { get; set; } [Display(Name = "File nội dung")] public string NameLessonFile { get; set; } [Display(Name = "Khóa học")] public string Course { get; set; } public int CountReport { get; set; } } } 6.1.20 File RawCourse_Model.cs using Microsoft.AspNetCore.Http; using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; SVTH: NGUYỄN HOÀNG THIÊN ÂN 210 (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core Luan van (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core Đồ án tốt nghiệp khóa 2017-2021 Trường Đại học Bà Rịa- Vũng Tàu using System.Threading.Tasks; namespace DATN.Models { public class RawCourse_Model { public int Id { get; set; } [Required(ErrorMessage = "Tên khóa học khơng bỏ trống")] [DisplayName("Tên khóa học")] public string Name_Course { get; set; } [Required(ErrorMessage = "Mã khóa học khơng bỏ trống")] [DisplayName("Mã khóa học")] [StringLength(10, MinimumLength = 10, ErrorMessage = "Mã khóa học phải đủ 10 kí tự")] public string ID_Course { get; set; } [DisplayName("Ngày mở")] [Required(ErrorMessage = "Ngày mở khóa học khơng bỏ trống")] [DataType(DataType.Date)] public string Date_Course { get; set; } [DisplayName("Hình ảnh khóa học")] [Required(ErrorMessage ="Hình ảnh khóa học khơng bỏ trống")] [DataType(DataType.Upload)] public IFormFile ImageCourse { get; set; } public string ImageCourseName { get; set; } } } SVTH: NGUYỄN HOÀNG THIÊN ÂN 211 (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core Luan van (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core Đồ án tốt nghiệp khóa 2017-2021 6.1.21 Trường Đại học Bà Rịa- Vũng Tàu File ReportModel.cs using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; namespace DATN.Models { public class ReportModel { public int Id { get; set; } public string Title { get; set; } public string Content { get; set; } public StatusReport StatusReport { get; set; } public int StatusReportId { get; set; } public int Lessons_ModelId { get; set; } public Lessons_Model Lessons { get; set; } public virtual ICollection Users_Reports { get; set; } } } 6.1.22 File ReportViewModel.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; SVTH: NGUYỄN HOÀNG THIÊN ÂN 212 (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core Luan van (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core Đồ án tốt nghiệp khóa 2017-2021 Trường Đại học Bà Rịa- Vũng Tàu using System.Linq; using System.Threading.Tasks; namespace DATN.Models { public class ReportViewModel { public int Id { get; set; } [DisplayName("Tiêu đề")] [Required(ErrorMessage = "Tiêu đề không bỏ trống")] public string Title { get; set; } [DisplayName("Nội dung")] [Required(ErrorMessage ="Nội dung không bỏ trống")] public string Content { get; set; } public int StatusReportId { get; set; } [DisplayName("Trạng thái")] public string Status { get; set; } public int Lessons_ModelId { get; set; } [DisplayName("Bài học")] public string Lesson { get; set; } public int User_Id { get; set; } [DisplayName("Người gửi")] public string User_Email { get; set; } [DisplayName("Ngày gửi báo cáo")] [DataType(DataType.Date)] public string Date_Report { get; set; } } } SVTH: NGUYỄN HOÀNG THIÊN ÂN 213 (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core Luan van (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core Đồ án tốt nghiệp khóa 2017-2021 6.1.23 Trường Đại học Bà Rịa- Vũng Tàu File StatusReport.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; namespace DATN.Models { public class StatusReport { public int Id { get; set; } [Required(ErrorMessage ="Trạng thái không bỏ trống")] [StringLength(50,ErrorMessage ="Trạng thái vượt 50 kí tự")] [DisplayName("Trạng thái")] public string Status { get; set; } public virtual ICollection Reports { get; set; } } } 6.1.24 File Users_Courses_Model.cs using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace DATN.Models SVTH: NGUYỄN HOÀNG THIÊN ÂN 214 (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core Luan van (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core Đồ án tốt nghiệp khóa 2017-2021 Trường Đại học Bà Rịa- Vũng Tàu { public class Users_Courses_Model { public int Id { get; set; } public int Users_ModelID { get; set; } public Users_Model Users { get; set; } public int Courses_ModelId { get; set; } public Courses_Model Courses { get; set; } } } 6.1.25 File Users_Model.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; namespace DATN.Models { public class Users_Model { [Key] public int ID { get; set; } [Required(ErrorMessage = "Email không bỏ trống")] [StringLength(50, MinimumLength = 10 , ErrorMessage = "Email nhỏ 10 kí tự")] SVTH: NGUYỄN HỒNG THIÊN ÂN 215 (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core Luan van (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core Đồ án tốt nghiệp khóa 2017-2021 Trường Đại học Bà Rịa- Vũng Tàu [DataType(DataType.EmailAddress, ErrorMessage = "Định dạng Email không hợp lệ")] [DisplayName("E-mail")] public string Email { get; set; } [Required(ErrorMessage = "Password không bỏ trống")] [StringLength(50, MinimumLength = 6, ErrorMessage = "Password nhỏ kí tự")] [DataType(DataType.Password)] [DisplayName("Password")] public string PassWord { get; set; } [Required(ErrorMessage = "Số điện thoại không bỏ trống")] [StringLength(10, MinimumLength = 10, ErrorMessage = "Số điện thoại phải có đủ 10 số")] [DataType(DataType.PhoneNumber,ErrorMessage ="Định dạng Số điện thoại không hợp lệ")] [DisplayName("Số điện thoại")] public string PhoneNumber { get; set; } [Required(ErrorMessage = "Họ không bỏ trống")] [StringLength(10, MinimumLength = 1)] [DisplayName("Họ")] public string Last_Name { get; set; } [Required(ErrorMessage = "Tên không bỏ trống")] [StringLength(10, MinimumLength = 1)] [DisplayName("Tên")] public string First_Name { get; set; } public virtual ICollection Users_Reports { get; set; } public virtual ICollection Users_Courses { get; set; }} } SVTH: NGUYỄN HOÀNG THIÊN ÂN 216 (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core Luan van (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core Đồ án tốt nghiệp khóa 2017-2021 6.1.26 Trường Đại học Bà Rịa- Vũng Tàu File Users_Report.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; namespace DATN.Models { public class Users_Report { public int Id { get; set; } public Users_Model Users { get; set; } public int Users_ModelId { get; set; } public ReportModel Report { get; set; } public int ReportModelId { get; set; } [DisplayName("Ngày mở")] [Required(ErrorMessage = "Ngày mở khóa học khơng bỏ trống")] [DataType(DataType.Date)] public string Date_Report { get; set; } } } SVTH: NGUYỄN HOÀNG THIÊN ÂN 217 (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core Luan van (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core Đồ án tốt nghiệp khóa 2017-2021 Trường Đại học Bà Rịa- Vũng Tàu 6.2 Sơ đồ cấu trúc 6.2.1 Xây dựng website bán hàng Asp.net Core 6.2.2 Thư mục wwwroot • CSS: chứa file Css sử dụng website • Images: chứa file hình ảnh khóa học giảng upload từ máy tính • Js: chứa file javascripts • Lib: chưa thư viện bootstrap jquery • LogFile: Chứa file nội dung mail soạn sẵn • Docxlog: Chứa file nội dung giảng dạng docx html 6.2.3 Thư mục Areas Chứa đối tượng tham gia vào hệ thống website: • Admin • Courses SVTH: NGUYỄN HOÀNG THIÊN ÂN 218 (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core Luan van (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core Đồ án tốt nghiệp khóa 2017-2021 Trường Đại học Bà Rịa- Vũng Tàu • Lessons • Report • Users Mỗi thư mục chứa file: Controllers, Views, Data… ➔ Chia đối tượng tham gia vào hệ thống website để dễ dàng xây website theo đối tượng dễ dàng quản lý chức riêng biệt đối tượng 6.2.4 Thư mục Controllers Chứa file code C# quản lý: Home: Chứa liên quan đến đối tượng users chưa đăng nhập vào hệ thống phần giao diện Users đăng nhập vào hệ thống… Trong HomeController phần code quản lý View như: Index, Login, Register, … 6.2.5 Thư mục View Chứa file cshtml (file giao diện): ➔ Thư mục chứa file giao diện sinh phần HomeController Các file giao diện file giao diện bản, dùng chung cho đối tượng tham gia vào hệ thống website SVTH: NGUYỄN HOÀNG THIÊN ÂN 219 (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core Luan van (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core Đồ án tốt nghiệp khóa 2017-2021 Trường Đại học Bà Rịa- Vũng Tàu 6.2.6 Thư mục Migration File chứa code quản lý tự động sinh thay đổi Migration update Database 6.2.7 Thư mục Models Chứa lớp Models sử dụng website Bao gồm Models CSDL ViewModel SVTH: NGUYỄN HOÀNG THIÊN ÂN 220 (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core Luan van (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core Đồ án tốt nghiệp khóa 2017-2021 Trường Đại học Bà Rịa- Vũng Tàu 6.2.8 Thư mục Services Chứa file code C# chứa dịch vụ có hệ thống 6.3 Các Extend sử dụng website 6.3.1 Mailkit a Thông tin Mailkit cho phép người dùng gửi mail có tập tin đính kèm b Cách sử dụng mailkit để gửi mail asp.net Bước 1: Thêm Mailkit Nuget package vào project Bước 2: Thêm thư viện MailKit.Net.Smtp MaineKit vào class controller SVTH: NGUYỄN HOÀNG THIÊN ÂN 221 (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core Luan van (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core Đồ án tốt nghiệp khóa 2017-2021 Trường Đại học Bà Rịa- Vũng Tàu Bước 3: Phương thức để gửi Email Bước 4: Kết nối đến SMTPClient gửi mail Bước 5: Hoàn tất SVTH: NGUYỄN HOÀNG THIÊN ÂN 222 (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core Luan van (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core Đồ án tốt nghiệp khóa 2017-2021 Trường Đại học Bà Rịa- Vũng Tàu 6.3.2 AspNetCore.Session a Thông tin Session chế để lưu lại liệu phiên làm việc cho ứng dụng ứng với khách truy cập Để trao đổi liệu từ trang qua trang khác Ví dụ người dùng đăng nhập, thơng tin đăng nhập lưu lại chuyển cho trang khác phiên làm việc để khỏi lần gửi request lại phải đăng nhập, hay người dùng chọn đựa mặt hàng vào giỏ hàng phải nhớ chuyển đến trang toán, … b Cách sử dụng Session để lưu trạng thái hoạt động Bước 1: Thêm Session vào NuGet Package Bước 2: Kích hoạt session ASP.NET Mở lớp Startup thêm vào phương thức ConfigureServices Configure code sau: • ConfigureServices • Configure Bước 3: Sử dụng Session class controller SVTH: NGUYỄN HOÀNG THIÊN ÂN 223 (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core Luan van (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core (Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core(Luan.van.tot.nghiep).xay.dung.ung.dung.website.hoc.tap.online.bang.asp.net.core

Ngày đăng: 29/12/2023, 03:25

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan