在网上搜了下,有PHP的,有ASP的,就是没有.NET的~
我想在自己的网页上加入sogou Rank和google Rank显示功能
哪位大大知道他们的值是怎么获取的,
代码怎么写~不胜感激~
我想在自己的网页上加入sogou Rank和google Rank显示功能
哪位大大知道他们的值是怎么获取的,
代码怎么写~不胜感激~
解决方案 »
- StringBuilder删除数据应该怎么写?
- spread 导出Excel 路径问题
- 反射中Type.GetProperty("...")无法获取属性对象的问题
- 如何用C#实现实时快速查询和筛选?
- 第二个子窗体更改数据,第一个窗体是打开状态,如何让第一个窗体的数据重新刷新?
- 文本字数太长,超过要插入数据库的长度,怎么截断?
- 用C#做移动程序,当数据量大的时候,如何实现dataGrid分页
- 用mciSendString在C#中播放avi的问题
- asp.net(C#)数据库连接问题
- c++变量 unsigned char **ppbyOutGrayImage 转 c#变量
- 请教:在C#中能不能实现类似于迅雷那样,在IE中右键点击一个链接,弹出应用软件的窗口并获取该链接的URL!
- 如何把整个ini文件读成一个字符串?
Dim sogouStr,r,sogoup
Function GetPage(url)
dim SendData,Retrieval
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "post", url, False
.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
.setRequestHeader "User-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)"
.Send()
GetPage = BytesToBstr(.ResponseBody)
End With
Set Retrieval = Nothing
End Function
Function BytesToBstr(body)
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 = "GB2312"
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
Function GetContent(str,start,last,n)
If Instr(lcase(str),lcase(start))>0 then
select case n
case 0 '左右都截取(都取前面)(去处关键字)
GetContent=Right(str,Len(str)-Instr(lcase(str),lcase(start))-Len(start)+1)
GetContent=Left(GetContent,Instr(lcase(GetContent),lcase(last))-1)
case 1 '左右都截取(都取前面)(保留关键字)
GetContent=Right(str,Len(str)-Instr(lcase(str),lcase(start))+1)
GetContent=Left(GetContent,Instr(lcase(GetContent),lcase(last))+Len(last)-1)
case 2 '只往右截取(取前面的)(去除关键字)
GetContent=Right(str,Len(str)-Instr(lcase(str),lcase(start))-Len(start)+1)
end select
Else
GetContent=""
End if
End functionr=request("r")
if r="" then r="此处换成你的blog地址"
sogoustr=GetPage("sogou.com/web?query=" target="_blank">http://www.sogou.com/web?query="&r)
sogoup=GetContent(sogoustr,"<img src=""/images/pr.gif"" width=""","%""",0)
response.Write "document.write(""<div style='font: 11px/11px Arial, Helvetica, sans-serif;color: #137258;"
response.Write "height: 14px;margin-top: 4px;'>"
response.Write "<div style='float: left;margin-right: 3px;'>Sogou Rank</div>"
response.Write "<span style='overflow-y:hidden;width: 65px;height: 7px;_width /**/: 69px;_height /**/: 11px;"
response.Write "padding: 2px;float: left;background: url(/prbar.gif) no-repeat left;'>"
response.Write "<img src='/pr.gif' width="&sogoup&"% height=7/></span>"&sogoup&"</div>"")"
set sogouStr=nothing
set sogoup=nothing
set r=nothing
%>这是网上一个读取sogou Rank的代码,不知哪个大大可以完善一下`
好像是ASP的吧,改成c#是最好
最近自己参考了一些资料,实现了用ASP.NET获取SOGOU RANK,
大家可以去我的个人博客查:www.fmiss.com
或在本人在CDSN的博客上也有!