<%
' 讀取用戶輸入的賬號和密碼.
UserID = Request("UserID")
Password = Request("Password")
' 檢查UserID及Password是否正確.
If UserID <>"hrmis" Or Password <>
"password" Then
Response.Write "噢,您的口令錯誤!請重新輸入."
Response.End
End If
' 將Session 對象設置為通過驗證狀態 .
Session("Passed") = True
%>
----------------------------------------------------------------------------------------------------------------
' 進入應用程序後,首先進行驗證:
<%
' 如果未通過驗證,返回Login狀態.
If Not Session("Passed") Then
Response.Redirect "Login.asp"
End If
%>
----------------------------------------------------------------------------------------------------------------
[1]