以下是代码: <% on error resume next Dim objXMLHTTP, xml Set xml = Server.CreateObject("Microsoft.XMLHTTP") xml.Open "GET", "http://chanye.finance.sina.com.cn/yj/2005-01-05/236914.shtml", False xml.Send tmpstr= xml.responseText ep=clng(instr(1,tmpstr,"meta_data2"))+18 tmpstr=replace(tmpstr,vbcrlf,"") tmpstr=replace(tmpstr,chr(9),"") tmpstr=replace(tmpstr,chr(32),"") mydata=mid(tmpstr,1,ep) recfilen=server.MapPath("tempstr.txt") set Astream=Server.CreateObject("Adodb.Stream") Astream.type=2 Astream.Mode = 3 Astream.open Astream.CharSet = "GB2312" Astream.Position =0 Astream.Writetext mydata,1 Astream.SaveToFile recfilen,2 Astream.close set Astream1=Server.CreateObject("Adodb.Stream") Astream1.type=2 Astream1.Mode = 3 Astream1.CharSet = "GB2312" Astream1.open Astream1.LoadFromFile(recfilen) Assp=Astream1.size crttmpstr=Astream1.ReadText(Assp) Astream1.close sp1=clng(instr(1,crttmpstr,"meta_data1"))+16 ep1=clng(instr(sp1,crttmpstr,"NAME=meta_data2"))-7 lth1=ep1-sp1 newdata=mid(crttmpstr,sp1,lth1) %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <style> body{ font-size:12px } td{ font-size:12px } </style> <title>用Asp获取Dll加密新闻内容</title> <table width="540" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td>更新时间:<%=now %>获取内容长度:<%=lth1 %> 字节 注意要使用http://127.0.0.1/Ip1HtmlView.dll你得先下载这个Dll文件,怎么下不用多说吧?! <object id=HtmlIp1View codebase=http://127.0.0.1/Ip1HtmlView.dll#version=1,0,1,14 classid=CLSID:D854FC15-D3EA-496A-B2A0-A772A3DE1D09> <param name="meta_data1" value="<%=newdata %>"> <param name="meta_data2" value=""> <param name="meta_data3" value=""> <param name="meta_data4" value=""> <param name="meta_data5" value=""> <param name="meta_data6" value=""> <param name="meta_data7" value=""> <param name="meta_data8" value=""> <param name="baseurl" value="111"> <param name="random" value="111"> </object></td> </tr>
</table>
</body> </html> |