以下是代碼:
<%
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>更新