我的人生路  
日历
<2005年7月>
262728293012
3456789
10111213141516
17181920212223
24252627282930
31123456
统计
  • 随笔 - 74
  • 文章 - 57
  • 评论 - 7
  • 引用 - 0

导航

常用链接

留言簿(5)

随笔分类

随笔档案

文章分类

文章档案

相册

颜色

搜索

  •  

最新评论

阅读排行榜

评论排行榜

 
<%
On Error Resume Next
Server.ScriptTimeOut=9999999
Function getHTTPPage(Path)
t = GetBody(Path)
getHTTPPage=BytesToBstr(t,"gb2312")
End function

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

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 Newstring(wstr,strng)
Newstring=Instr(lcase(wstr),lcase(strng))
if Newstring<=0 then Newstring=Len(wstr)
End Function
qq = "123456"
url="http://webpresence.qq.com/getonline?Type=1&"&qq&":"
wstr=getHTTPPage(url)
if wstr = "online[0]=0;" then
response.write "unonline"
else
response.write "online"

end if

%>

这是我网站中的部分代码,我提取了其中部分,已经算是完整的了。可以正常截取QQ在线离线信息。当然你可以调整XMLHTTP.ReadyState,实时获取数据。


欢迎大家访问我的个人网站 萌萌的IT人
posted on 2005-07-07 17:44 一天一点爱恋 阅读(222) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航:
 
 
Copyright © 一天一点爱恋 Powered by: 博客园 模板提供:沪江博客