本文发表在 rolia.net 枫下论坛Application("connStr") = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=e:\\MP3DB.mdb"
var logIP = "INSERT INTO IPLOG VALUES ('" + Session("IP") + "', 1, #" + get_MMDDYYYY_datetime() + "#)"
Session("IP") = String(Request.ServerVariables("REMOTE_ADDR"))
var log = Server.CreateObject("ADODB.Command");
log.ActiveConnection = Application("connStr");
log.CommandText = logIP;
log.Execute();
function get_MMDD_date(dat) {
var month = "0" + (dat.getMonth() + 1)
month = month.substr(month.length-2)
var day = "0" + dat.getDate()
day = day.substr(day.length-2)
return (month + day)
}
function get_MMDDYYYY_datetime(){
var Today = new Date()
return get_MMDDYYYY_date(Today) + " " + get_HHMMSSTT_time(Today)
}
function get_HHMMSSTT_time(dat) {
var vMinutes = "0" + dat.getMinutes()
vMinutes = vMinutes.substr(vMinutes.length-2)
var vSeconds = "0" + dat.getSeconds()
vSeconds = vSeconds.substr(vSeconds.length-2)
var vHours = dat.getHours()
if (vHours > 11) {
vHours = vHours - 12
vHours==0?vHours=12:vHours=vHours
return (vHours + ":" + vMinutes + ":" + vSeconds + " PM")
}
else {
vHours==0?vHours=12:vHours=vHours
return (vHours + ":" + vMinutes + ":" + vSeconds + " AM")
}
}更多精彩文章及讨论,请光临枫下论坛 rolia.net
var logIP = "INSERT INTO IPLOG VALUES ('" + Session("IP") + "', 1, #" + get_MMDDYYYY_datetime() + "#)"
Session("IP") = String(Request.ServerVariables("REMOTE_ADDR"))
var log = Server.CreateObject("ADODB.Command");
log.ActiveConnection = Application("connStr");
log.CommandText = logIP;
log.Execute();
function get_MMDD_date(dat) {
var month = "0" + (dat.getMonth() + 1)
month = month.substr(month.length-2)
var day = "0" + dat.getDate()
day = day.substr(day.length-2)
return (month + day)
}
function get_MMDDYYYY_datetime(){
var Today = new Date()
return get_MMDDYYYY_date(Today) + " " + get_HHMMSSTT_time(Today)
}
function get_HHMMSSTT_time(dat) {
var vMinutes = "0" + dat.getMinutes()
vMinutes = vMinutes.substr(vMinutes.length-2)
var vSeconds = "0" + dat.getSeconds()
vSeconds = vSeconds.substr(vSeconds.length-2)
var vHours = dat.getHours()
if (vHours > 11) {
vHours = vHours - 12
vHours==0?vHours=12:vHours=vHours
return (vHours + ":" + vMinutes + ":" + vSeconds + " PM")
}
else {
vHours==0?vHours=12:vHours=vHours
return (vHours + ":" + vMinutes + ":" + vSeconds + " AM")
}
}更多精彩文章及讨论,请光临枫下论坛 rolia.net