天枫常用的ASP函数封装如下(13)
JMail.ServerAddress=MailServerAddress
JMail.AddRecipient=AddRecipient
JMail.Subject=Subject
JMail.Body=MailBody
JMail.Sender=Sender
JMail.From = MailFrom
JMail.Priority=1
JMail.Execute
Set JMail=nothing
if err then
SendMail=err.description
err.clear
else
SendMail="OK"
end if
end function
'****************************************************
'函数名:ResponseCookies
'作 用:写入COOKIES
'参 数:Key ----cookie名
' value ----cookie值
' expires ---- cookie过期时间
'****************************************************
Public Function ResponseCookies(Key,Value,Expires)
DomainPath=Left(Request.ServerVariables("script_name"),inStrRev(Request.ServerVariables("script_name"),"/"))
Response.Cookies(Key)=""&Value&""
if Expires<>0 then Response.Cookies(Key).Expires=date+Expires
Response.Cookies(Key).Path=DomainPath
End Function
'****************************************************
'函数名:CleanCookies
'作 用:清除COOKIES
'****************************************************
Public Function CleanCookies()
DomainPath=Left(Request.ServerVariables("script_name"),inStrRev(Request.ServerVariables("script_name"),"/"))
For Each objCookie In Request.Cookies
Response.Cookies(objCookie)= ""
Response.Cookies(objCookie).Path=DomainPath
Next
End Function
'****************************************************
'函数名:GetTimeOver
'作 用:清除COOKIES
'参 数:flag ---显示时间单位1=秒,否则毫秒
'****************************************************
Public Function GetTimeOver(flag)
Dim EndTime
If flag = 1 Then
EndTime=FormatNumber(Timer() - StartTime, 6, true)
getTimeOver = " 本页执行时间: " & EndTime & " 秒"
Else
EndTime=FormatNumber((Timer() - StartTime) * 1000, 3, true)
getTimeOver =" 本页执行时间: " & EndTime & " 毫秒"
内容版权声明:除非注明,否则皆为本站原创文章。