澳大利亚.新西兰C#考试题
下面是該網站登錄流程的一個簡單示例:
1.您有一個簡單的Login.aspx表單,其中包含兩個名為txbUsername和txbPassword的文本框元素。 此外,還有一個名為btnSubmit的按鈕。
2.用戶分別在“用戶名”和“密碼”文本框中輸入電子郵件地址和密碼,然后單擊“提交”按鈕。
3.用戶層的Code Behind頁面Login.aspx.cs檢索每個文本框中的值,并將它們分配給兩個變量strUsername和strPassword
4.然后Login.aspx.cs在業務層(BL)中調用一個(例如Integer)方法/類,并傳遞兩個變量(strUsername,strPassword)
5.業務層類會再次檢查用戶名是否為有效的電子郵件地址,并且密碼字符串還會再次檢查其是否符合密碼要求。
6.業務層使用md5 hashing將密碼散列傳遞給數據訪問層
7.Once Error Checking complete the Business Layer code calls a method/class (again an Integer type) in the Data Access Layer passing the user name and hashed password.
8.數據訪問層方法檢索這兩個變量,并確定SQL命令的數量(3個需要檢查的關鍵情況)。包括:
SELECT * from tblUsers where Username = Username and Password=strPasswordHash; SELECT * from tblUsers where Username = Username;
9.根據您在數據訪問層中編碼的邏輯,您將具有三個要傳回的條件,可以分別將其分配給Integer值(0,1,2)
10.現在,該方法將Integer值返回到業務層。
11.業務層執行任何必需的附加業務邏輯。
12.然后,業務層將Integer值返回給用戶層中的Code Behind頁面。
13.后臺代碼中的代碼現在根據返回的整數(0,1,2)管理三種可能的場景之一。
提示:如果它是2,例如,用戶名和密碼組合都在數據庫中找到,所以登錄成功,所以重定向到主菜單
原文
An articulated simple example of the Logic Flow for the Login Process (that will also be provided in codified form) is as follows
1.You have a simple Login.aspx form containing two text box elements called txbUsername and txbPassword. In addition, a single button called btnSubmit.
Users enter an email address and password into the Username and Password textboxes respectively and hit the Submit button.
The Code Behind page in the User Layer, Login.aspx.cs retrieves the values in each respective textbox and assigns them to 2 variables, strUsername and strPassword.
The Login.aspx.cs then calls a (for example Integer) method/class in the Business Layer passing the two variables (strUsername, strPassword).
The Business Layer class double checks the Username is a valid email address, and the Password string also double checks it meets any password requirements.
The Business layer hashes the password using md5 hashing to pass to the data access layer
Once Error Checking complete the Business Layer code calls a method/class (again an Integer type) in the Data Access Layer passing the user name and hashed password.
The Data Access Layer method retrieves the two variables and formulates number of SQL Commands (3 key cases to check). Including: SELECT * from tblUsers where Username = Username and Password=strPasswordHash; SELECT * from tblUsers where Username = Username;
Based on the logic you code in the Data Access Layer you will have three conditions to pass back that you can assign respectively to values (0,1,2)
The method now returns the Integer value to the Business Layer.
The Business Layer performs any required additional business logic.
The Business Layer then returns the Integer value to the Code Behind page in the User Layer.
Code in the code behind page now manages one of three possible scenarios based on the returned integer. HINT: if it is a 2, for example, both Username and Password combination were found in the DB so login successful so Redirect to the main menu
網站評分要求
Business Layer Design and Implementation (8 marks) BL層
正確的n層架構實現了正確的業務層。 1分
該層應該只由用c#編寫的.cs文件組成。 1分
正確使用公共和私有類/方法分類(Public and Private class/method) 1分
使用駝峰大小寫正確使用和命名該層中的變量。 1分
演示了在業務層之間傳遞數據類型和對象的能力。 1分
能夠理解使用類和方法進行面向對象的設計和開發。 1分
應該正確地命名和實例化對象。 1分
我們提供一個虛擬支付系統來支付,這應該用于模擬遠程支付 1分
Data Access Layer Design and Implementation (8 marks)DAL層
正確的n層架構實現了正確的數據訪問層。1分
該層應該只由用c#編寫的.cs文件組成。 1分
應該正確地命名和實例化對象。 1分
正確使用公共和私有類/方法分類。(Public and Private class/method) 1分
使用駝峰大小寫正確使用和命名該層中的變量。 1分
演示了在數據訪問層之間傳遞數據類型和對象的能力。1分
演示了使用ADO.NET的SQL命令向數據層傳遞數據和從數據層傳遞數據的能力。2分
Error Checking and Robustness (5 marks) 錯誤檢查
所有可能導致應用程序“崩潰”的方法和其他代碼塊都應該包含在“Try-Catch-Finally”代碼塊中。1分
數據在層之間傳遞時應該進行錯誤檢查和驗證。 1分
錯誤檢查應該到位,以管理過期的會話變量。 1分
提供了一個通用錯誤處理頁面,以優雅地管理用戶反饋。1分
應用程序應該是穩健的,正常運行時不會崩潰。1分
Code Commenting and Readability (3 marks) 代碼注釋和可讀性
所有代碼塊、頁面、方法和類都應該有足夠的注釋來解釋各自的功能及其目的。2分
用于確保代碼可讀的空白和格式。 1分
SSL(https) and Email Capabilities (6 marks) SSL(https)和電子郵件功能
在關鍵地方使用SSL以確保安全內容:?
? 所有購物車頁面應該是安全的。1分
?? 所有的支付功能頁面應該是安全的。1分
?? 管理部分中的管理頁面應該是安全的。1分
使用來自應用程序的功能電子郵件進行關鍵事件:
? 忘記密碼功能。 1分
? 確認管理員注冊驗證的電子郵件驗證。1分
? 當客戶進行購買和最終付款時,將發票/銷售的電子郵件副本發送給客戶。1分
Correct Project Structure (2 marks) 正確的項目結構
業務層(BL)文件夾,包含與該層相關的所有類文件。 0.5分
數據訪問層(DAL)文件夾,包含與該層相關的所有類文件。0.5分
用戶層(UL)文件夾,包含與該層相關的所有ASPX(和.cs)頁面。0.5分
其他必要的文件夾,如IMG(用于圖像)、SCRIPT(用于腳本類)和CSS(用于樣式表)0.5分
Friendly URLs, State Management, and Admin Functionality (6 marks)
正確使用友好的url 2分
Session變量、購物車項目等的狀態管理 2分
功能齊全的“管理”部分,允許添加/更新/停用待售物品,管理用戶帳戶,管理郵資選項等2分
Documentation and any required supporting material and correct submission
(2 marks)
你所獲得的任何代碼的參考資料,設計的理由和編碼的選擇等等。
提交一個單一的ZIP文件,包括所有的Visual Studio項目/解決方案文件,使用正確的命名格式為ZIP和項目(例如:cXXXXXXX-Assig1,其中XXXXXXX是你提交的學生號,或者如果在一個組GROUPNAME-Assig1)。
提交按照上述格式命名的SQL腳本文件
寫一個支持文檔包括
a. 網站該如何使用。
b。 管理員部分的登錄詳細信息,以及Web應用程序本身的至少一個用戶登錄。
C。 清楚地闡明和解釋自作業第1部分以來您對數據庫或用戶層所做的任何更改。
d。 您所獲得的不是您自己的任何代碼/圖像或其他數字內容的引用。
總結
以上是生活随笔為你收集整理的澳大利亚.新西兰C#考试题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C#阶段考试
- 下一篇: Java编程讲义之Eclipse开发工具