boysky85
(boysky85)
注册会员

初级会员
UID 62978
精华
0
积分 106
帖子 71
金钱 106 喜悦币
威望 0
人脉 0
阅读权限 20
注册 2005-1-7
状态 离线
|
[广告]: q
m
考考您理解代码的能力
请问下面这段代码的含义ASP的,如果"翻译成php应该怎样写"
------------------------------------------------------------------------------------------------------------------------------------
On Error Resume Next
Dim Cuiz
Cuiz = ""
Cuiz = request.QueryString("url")
If Cuiz = "" Or Len(Cuiz) < 10 Then
response.write ("test")
response.End
End If
Server.ScriptTimeOut=999
Public Function CuizHTTPPage(Path)
Dim t
t = GetBody(Path)
CuizHTTPPage=BytesToBstr(t,"GB2312")
End function
Public Function GetBody(url)
On error resume next
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", url, False, "", ""
.Send
GetBody = .ResponseBody
End With
Set Retrieval = Nothing
End Function
Public Function BytesToBstr(body,Cset)
on error resume next
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
response.write CuizHTTPPage(Cuiz)
----------------------------------------------------------------------------------------------------------------
|
|