<%
dim url,mystr
url="
http://www.skyexam.com/RegExamPlan/ExamPlacePlanMore.aspx?PlaceID=22&PKID=51"
mystr=GetPage(url)
if instr(mystr,"YHNO") then
response.write "查看失败"
elseif instr(mystr,"暂无考试计划信息") then
response.write "暂时没有计划"
else
response.write "可以报名了"
end if
Function BytesToBstr(body,Cset)
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
function GetPage(url)
Dim xml
'Set xml = Server.CreateObject("Microsoft.XMLHTTP")
Set xml = Server.CreateObject("MSXML2.ServerXMLHTTP")
xml.Open "GET", url, False
xml.Send
if xml.responseText<>"" then
GetPage=BytesToBstr(xml.ResponseBody,"UTF-8")
'GetPage=BytesToBstr(xml.responseText,"UTF-8")
'获得返回值
else
GetPage="YHNO"
'无法获得返回值
end if
Set xml = Nothing
end function
%>