<!--#include file="conn/conn.asp"-->
<%
sqlm ="select fid from fid_table "
set rs =server.CreateObject("adodb.Recordset")
rs.open sqlm ,conn,1,1
'if rs.eof then
'response.Write("数据不存在!")
'else
if rs("fid")< 1707 then
response.Write("更新了"&rs("fid")&"次数据")
sqk ="update fid_table set fid =fid+1"
conn.execute(sqk)
Response.Write "<script language='javascript'>setTimeout('this.location.reload()',5000);</script>"
else
response.Write("数据已经更新完毕")
end if
%>
<%
Function FilterHTML(strToFilter)
Dim strTemp
strTemp = strToFilter
While Instr(1, strTemp,"<")>0 and Instr(1,strTemp,">")>0
strTemp = Left(strTemp, Instr(1, strTemp,"<")-1)+ Right(strTemp,Len(strTemp) -Instr(1,strTemp,">"))
WEnd
FilterHTML = strTemp
End Function
function shift(str)
str =left(str,5000)
str =right(str,len(str) - 200)
str =replace(str,chr(32),"")
str =replace(str,chr(13)&chr(10)&chr(13)&chr(10)&chr(13)&chr(10),chr(13)&chr(10))
str =replace(str,chr(13)&chr(10)&chr(13)&chr(10)&chr(13)&chr(10)&chr(13)&chr(10),chr(13)&chr(10))
str =replace(str,chr(13)&chr(10)&chr(13)&chr(10),chr(13)&chr(10))
str =replace(str,chr(13)&chr(10)&chr(13)&chr(10)&chr(13)&chr(10)&chr(13)&chr(10)&chr(13)&chr(10),chr(13)&chr(10))
str =replace(str,chr(13)&chr(10),",")
str =replace(str,",,",",")
shift =str
end function
'response.Write(path)
Set fso = Server.CreateObject("Scripting.FileSystemObject")
'path = "c: emp est.txt"
'ForReading = 1
'ForWriting = 2
'ForAppending = 3
set file = fso.OpenTextFile ("e:web/tel.txt",8,True)
'response.Write(FilterHTML(strm))
' response.Write(left(strm,10))
ServerURL="http://www.cn1860.net/sms/search1.asp?province=&city=&page=1"'&rs("fid")
' ServerURL="http://www.cn1860.net/sms/search1.asp"
Set Mail1 = Server.CreateObject("CDO.Message")
Mail1.CreateMHTMLBody ServerURL,31
AA=Mail1.HTMLBody
Set Mail1 = Nothing
'response.Write(trim(file_html(shift(AA))))
' create the fso object
dateHtml =right(shift(FilterHTML(aa)),len(shift(FilterHTML(aa))) -1)
asm =split(dateHtml,",")
sum_ = ubound(asm,1) + 1
'response.Write(UBound(asm,1))
response.Write(sum_ & "<br/>")
i=9
for i=0 to sum_ -1 step 5
on error resume next
if asm(i) <>"" then
if err.number <> 0 then
response.Write(i)
exit for
end if
on error goto 0
if i + 4 >sum_ then
exit for
else
'response.Write(i & "<br/>")
'response.Write((i*5+1) &"<br/>")
if isnumeric(trim(asm(i+1))) and isnumeric(trim(asm(i))) then
'Option Explicit
On Error Resume Next
'response.Write("Message")
sql="insert into MobileDB(num,Area,City,Tsype)values('"&asm(i+1)&"','"&asm(i+2)&"','"&asm(i+3)&"','"&asm(i+4)&"')"
conn.Execute(sql)
If Err.Number <> 0 then
Err.Clear
Err.Raise vbObjectError
End If
end if
'response.Write(asm(i))
end if
end if
next
'tam = split(trim(file_html(shift(AA))),"""")
'num=(UBound(tam ,1))
' i=0
' while tam(i)<>""
' response.Write(tam(i))
' i=i+1
' wend
'for i=0 to num
'response.Write(tam(i))
'next
file.write(date()&" "&time()&"第"&rs("fid")&"次:Erro:"&err.number) & vbcrlf
file.close
set file = nothing
set fso = nothing
rs.close
set rs =nothing
conn.close
set conn =nothing
%>