'格式转换函数,将发布的文本区域的内容,转换成HTML支持格式的模式,将VBS中的换行换成HTML中的换行
Function DoWhiteSpace(str)
DoWhiteSpace = Replace((Replace(str,vbCrlf,"<br>")),Chr(32)," ")
End Function
'获取访问者的IP
Function GetUserIP()
Dim UserIp
UserIp = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If UserIp = "" Then
UserIp = Request.ServerVariables("REMOTE_ADDR")
End If
GetUserIp=Trim(UserIp)
End Function
'===========================================================
'取得需要的时间格式:(时间,格式标志)
'设计:叶随风(Leafinwind)
'QQ:19855466
'获得指定格式的日期
'===========================================================
Function GetDateTime(DateTime, Flag)
Dim y, m, d, h, mi, s, Result
y = Year(DateTime)
m = Right("0" & Month(DateTime),2)
d = Right("0" & Day(DateTime),2)
h = Right("0" & Hour(DateTime),2)
mi = Right("0" & Minute(DateTime),2)
s = Right("0" & Second(DateTime),2)
Select Case Flag
Case "D"
Result = y & "-" & m & "-" & d
Case "D-2"
Result = y & "-" & m
Case "D-3"
Result = m & "-" & d
Case "T"
Result = h & ":" & mi & ":" & s
Case "T-2"
Result = h & ":" & mi
Case "DT"
Result = y & "-" & m & "-" & d & " " & h & ":" & mi & ":" & s
Case "DT-2"
Result = m & "-" & d & " " & h & ":" & mi & ":" & s
Case "HZ"
Result = y & "年" & m & "月" & d & "日 " & h & "时" & mi & "分" & s & "秒"
Case "HZ-1"
Result = y & "年" & m & "月" & d & "日"
Case "HZ-2"
Result = m & "月" & d & "日"
Case "HZ-3"
Result = y & "年" & m & "月"
Case "HZ-4"
Result = h & "时" & mi & "分" & s & "秒"
Case "HZ-5"
Result = h & "时" & mi & "分"
End Select
GetDateTime = Result
End Function