ASP常用函数收藏乱七八糟未整理版(68)
Rem 借助RecordSet将二进制流转化成文本
Quoted from Unkown:
Function BinaryToString(biData, Size)
Const adLongVarChar = 201
Set RS = CreateObject("ADODB.Recordset")
RS.Fields.Append "mBinary", adLongVarChar, Size
RS.Open
RS.AddNew
RS("mBinary").AppendChunk(biData)
RS.Update
BinaryToString = RS("mBinary").Value
RS.Close
End Function
%>
<%
'定义超全局变量
Dim URLSelf, URISelf
URISelf = Request.ServerVariables("SCRIPT_NAME")
If Request.QueryString = "" Then
URLSelf = URISelf
Else
URLSelf = URISelf & "?" & Request.QueryString
End If
Response.CharSet = "GB2312"
Response.Buffer = True
Response.Expires = -1
'===================================================================================
' 函数原型:GotoURL (URL)
'功能:转到指定的URL
'参数:URL 要跳转的URL
'返 回 值:无
'涉及的表:无
'===================================================================================
Public Function GotoURL(URL)
Response.Write "<script language=""JavaScript"">location.href='" & URL & "';</script>"
End Function
'===================================================================================
' 函数原型:MessageBox (Msg)
'功能:显示消息框
'参数:要显示的消息
'返 回 值:无
'涉及的表:无
'===================================================================================
Public Function MessageBox(msg)
msg = Replace(msg, "\", "\\")
msg = Replace(msg, "'", "\'")
msg = Replace(msg, """", "\""")
msg = Replace(msg, vbCrLf, "\n")
msg = Replace(msg, vbCr, "")
msg = Replace(msg, vbLf, "")
Response.Write "<script language=""JavaScript"">alert('" & msg & "');</script>"
End Function
'===================================================================================
' 函数原型:ReturnValue (bolValue)
'功能:设置Window对象的返回值:只能是布尔值
内容版权声明:除非注明,否则皆为本站原创文章。