久久―日本道色综合久久,亚洲欧美精品在线,狼狼色丁香久久婷婷综合五月,香蕉人人超,日本网站黄,国产在线观看不卡免费高清,无遮挡的毛片免费

2023信創(chuàng)獨角獸企業(yè)100強
全世界各行各業(yè)聯(lián)合起來,internet一定要實現(xiàn)!

如何利用ASP給主頁加密

2004-02-19 eNet&Ciweek

我們的目的是:

 ?。炞C用戶是否經(jīng)過授權(quán)并根據(jù)結(jié)果設置相應的驗證狀態(tài)

 ?。绻脩羰墙?jīng)過授權(quán)的,驗證狀態(tài)置1

 ?。绻脩羰菦]有授權(quán)的,驗證狀態(tài)置0

下面顯示的是verify.asp頁的代碼,你可以根據(jù)實際情況作一些相應的修改。

< %

’ Create a command object. This object serves to run our queries

Set Cm = Server.CreateObject(“ADODB.Command”)

’ Specify the system DSN path

Cm.ActiveConnection =“LoginDSN”

’ Now it’s time for the query. We need to check the user information

’ against the table tUsers

Cm.CommandText=“SELECT * FROM tUsers WHERE ”& _

“UserName=’”& Request.Form(“UserName”) &“’ AND ”& _

“UserPassword=’” & Request.Form(“UserPassword”) & “’”

’ Set the query type. 1 means it is a SQL statement

Cm.CommandType = 1

’ Retrieve the results in a recordset object

Set Rs = Cm.Execute

’ We now check if the user is valid. If user is valid, the recordset MUST

’ haverecord. Otherwise it is empty. If user exists, we set authentication

’ status to 1 and send the user to appropriate page, say welcome.asp.

’ Else send the user back to login.asp

If Rs.EOF Then

Session(“Authenticated”) = 0

Response.Redirect (“l(fā)ogin.asp”)

Else

Session(“Authenticated”) = 1

Response.Redirect (“welcome.asp”)

End If

%?。?


相關(guān)頻道: eNews

您對本文或本站有任何意見,請在下方提交,謝謝!

投稿信箱:tougao@enet16.com