主题:  有段ASP代码,大家看看

danieltys

职务:普通成员
等级:1
金币:1.0
发贴:146
注册:2001/8/9 11:47:49
#12001/11/12 19:05:30
<%@ LANGUAGE="VBSCRIPT" %>





Password.asp




User Name:


Password:








engine.asp:检验用户输入项
<%@ LANGUAGE="VBSCRIPT" %>

<%
' Connects and opens the text file
' DATA FORMAT IN TEXT FILE= "usernamepassword"

Set MyFileObject=Server.CreateObject
("Scripting.FileSystemObject")
Set MyTextFile=MyFileObject.OpenTextFile(Server.MapPath
("\path\path\path\path") & "\passwords.txt")

' Scan the text file to determine if the user is legal
WHILE NOT MyTextFile.AtEndOfStream
' If username and password found
IF MyTextFile.ReadLine = Request.form("username") & " " &
Request.form("password") THEN
' Close the text file
MyTextFile.Close
' Go to login success page
Session("GoBack")=Request.ServerVariables
("SCRIPT_NAME")
Response.Redirect "inyougo.asp"
Response.end
END IF
WEND

' Close the text file
MyTextFile.Close
' Go to error page if login unsuccessful
Session("GoBack")=Request.ServerVariables("SCRIPT_NAME")
Response.Redirect "invalid.asp"
Response.end

%>

invalid.asp :用户无效的口令时的页面
<%@ LANGUAGE="VBSCRIPT" %>





invalid.asp



You have entered an invalid username or password.


Try to log in again



inyougo.asp:用户的口令正确
<%@ LANGUAGE="VBSCRIPT" %>





In You Go



You have now entered the password protected page.


上面这段代码是我在一个网站上找到的,是如何使用 Microsoft Access 和 Active Server Pages 加密页面 的,代码是有了,可是我要如果使用这段代码呢?


(已转到“ASP及.net”)

编辑历史:[这消息被deathcult编辑过(编辑时间2001-11-13 01:40:45)]