这一部分解出来就是下边
<%
Function OpenOrGet_Database(SessionName )
Dim conn
If Not IsObject(Session(SessionName)) Then
Set conn = Server.CreateObject("ADODB.Connection")
db="aspdata/g0p0s1!#@001.mdb"
connstr="driver=2Microsoft Access Driver (*.mdb)};Pwd=gps001; dbq=" & Server.MapPath(""&db&"")
'connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"")
conn.Open connstr
Set Session(SessionName) = conn
End If
Set OpenOrGet_Database = Session(SessionName)
End Function
Function CheckPwd( ID, Pwd )
Dim conn, param, rs
Set conn = OpenOrGet_Database("gpsdepot_conn")
sql = "Select * From USERS Where USR_NAME = " & Sqlstr(ID)
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, conn, 1,1
Dim InitialPS.,PassWord,MyPass,Standard
If rs.RecordCount > 0 then
InitialPS. = rs("USR_INTPSW")
MyDate = Date()
MyYear = Year(MyDate)
MyMonth = Month(MyDate)
MyDay = Day(MyDate)
MyPass = (InitialPSW + 2 + MyYear +MyMonth)* MyDay
Password = Right(MyPass,6)
'Password = rs("USR_INTPSW")
Standard = Password n Pwd
End if
If rs.RecordCount <= 0 then
CheckPwd = False
Elseif rs.EOF Then
CheckPwd = False
Elseif Standard = 0 Then
CheckPwd = True
Session("Usr_Name") = ID
Session("Usr_IntPsw") = InitialPS.
Session("Usr_Company")= rs("USR_COMPANY")
Session("Usr_Class") = rs("USR_CLASS")
Session("Usr_Chnname") = rs("USR_CHNNAME")
Session("Usr_CMPCODE") = rs("CMP_CODE")
Session.timeout= 55
Else
CheckPwd = False
End If
End Function
%>
标签:LANGUAGE,VBScript,Encode