日期:2014-05-17 浏览次数:29250 次
Function GetHtml(paraHost,paraFileUrl) Dim Socket on error resume next Set Socket =Server.CreateObject("Socket.TCP") Socket.Host = paraHost & ":80" Socket.Timeout =80*1000 '80秒 If Err.Number <> 0 Then err.Clear Socket.open Socket.SendLine "GET " & paraFileUrl & " HTTP/1.0" Socket.SendLine "HOST: " & paraHost Socket.SendLine "" Socket.SendLine "" ' Sleep 200 Socket.WaitForDisconnect If Err.Number <> 0 Then GetText = "" ' response.write Err.Number & " -- " & Err.Description Err.Clear Else GetText = ParseRet(Socket.Buffer, 1) ' output text from socket End If Socket.Close Set Socket = Nothing End Function