以下是代码:
1
2on error resume next
3Dim objXMLHTTP, xml
4Set xml = Server.CreateObject("Microsoft.XMLHTTP")
5xml.Open "GET", " http://chanye.finance.sina.com.cn/yj/2005-01-05/236914.shtml ", False
6xml.Send
7tmpstr= xml.responseText
8ep=clng(instr(1,tmpstr,"meta_data2"))+18
9tmpstr=replace(tmpstr,vbcrlf,"")
10tmpstr=replace(tmpstr,chr(9),"")
11tmpstr=replace(tmpstr,chr(32),"")
12mydata=mid(tmpstr,1,ep)
13recfilen=server.MapPath("tempstr.txt")
14set Astream=Server.CreateObject("Adodb.Stream")
15Astream.type=2
16Astream.Mode = 3
17Astream.open
18Astream.CharSet = "GB2312"
19Astream.Position =0
20Astream.Writetext mydata,1
21Astream.SaveToFile recfilen,2
22Astream.close
23set Astream1=Server.CreateObject("Adodb.Stream")
24Astream1.type=2
25Astream1.Mode = 3
26Astream1.CharSet = "GB2312"
27Astream1.open
28Astream1.LoadFromFile(recfilen)
29Assp=Astream1.size
30crttmpstr=Astream1.ReadText(Assp)
31Astream1.close
32sp1=clng(instr(1,crttmpstr,"meta_data1"))+16
33ep1=clng(instr(sp1,crttmpstr,"NAME=meta_data2"))-7
34lth1=ep1-sp1
35newdata=mid(crttmpstr,sp1,lth1)
1<html>
2<head>
3<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
4<style>
5body{
6font-size:12px
7}
8td{
9font-size:12px
10}
11</style>
12<title>用Asp获取Dll加密新闻内容</title>
13<table align="center" border="0" cellpadding="0" cellspacing="0" width="540">
14<tr>
15<td>更新时间:```
16=now
17```获取内容长度:```
18=lth1
字节
注意要使用 http://127.0.0.1/Ip1HtmlView.dll 你得先下载这个Dll文件,怎么下不用多说吧?!