人人做人人澡人人爽欧美,国产主播一区二区,久久久精品五月天,羞羞视频在线观看免费

當前位置:蘿卜系統下載站 > 技術開發教程 > 詳細頁面

asp記錄日志程序

asp記錄日志程序

更新時間:2022-07-14 文章作者:未知 信息來源:網絡 閱讀次數:

'書寫日志的程序
?'username :用戶信息(標示進行該操作的人員)
'operate :操作(標示用戶進行了什么操作)
'userip :用戶IP(標示用戶用于登錄系統的計算機的IP地址)
'opdate :用戶操作發生的日期
'日志寫入一個xml文件,第一次寫入時如果xml文件不存在,則創建。 '返回值:0 表示輸入的參數無效 '返回值:1 表示打開日志文件時出錯 '返回值:9 表示正確完成寫入日志文件

?function WriteLog(username,operate,userip,opdate)
if username="" or operate="" or userip="" or opdate="" then
WriteLog=0 '參數無效
exit function
end if
RootNode="syslog"
'日志文件根節點名字
LogFile=server.mappath("uuu.xml") '日志文件路徑
set fso=server.CreateObject("scripting.filesystemobject")
'如果日志文件不存在,就創建一個,并寫入頭信息和根信息
if not fso.FileExists(LogFile) then
fso.CreateTextFile LogFile
set fff=fso.GetFile(LogFile)
set mmm=fff.openastextstream(2)?
mmm.write "《?xml version=""1.0"" encoding=""gb2312"" ?〉" & vbcrlf & "《" & rootnode & "〉《/" & rootnode & "〉"
set mmm=nothing
set fff=nothing
else
Response.Write("文件名沖突!")
Response.End
end if
set fso=nothing
Set xd = Server.CreateObject("msxml2.domdocument")
xd.async = false xd.load(LogFile)
if xd.parseError.errorcode<>0 then
WriteLog=1 '打開日志文件出錯
exit function
end if
'創建新節點信息
set et=xd.documentElement
set cnode=xd.createElement("log")
et.appendchild(cnode)
set node2=xd.createElement("username")
node2.text=username
cnode.appendchild(node2)
set node2=xd.createElement("operate")
node2.text=operate
cnode.appendchild(node2)
set node2=xd.createElement("userip")
node2.text=userip
cnode.appendchild(node2)
set node2=xd.createElement("opdate")
node2.text=opdate
cnode.appendchild(node2)
xd.save LogFile '寫入日志文件
set cnode=nothing
set node2=nothing
set xd=nothing
writeLog=9 '說明正常寫入了日志信息
end function

溫馨提示:喜歡本站的話,請收藏一下本站!

本類教程下載

系統下載排行

網站地圖xml | 網站地圖html
主站蜘蛛池模板: 揭西县| 兴安盟| 白水县| 中方县| 彭泽县| 睢宁县| 长宁区| 台山市| 苍梧县| 翁牛特旗| 托克逊县| 琼结县| 双柏县| 左云县| 江阴市| 宽甸| 内乡县| 扬中市| 闵行区| 珲春市| 神农架林区| 锡林郭勒盟| 武穴市| 湘潭市| 喀喇沁旗| 西吉县| 比如县| 岳西县| 秦皇岛市| 宁南县| 洛宁县| 泰州市| 泸溪县| 大同市| 巫山县| 文登市| 江阴市| 齐齐哈尔市| 新野县| 花垣县| 兴隆县|