时间: 2021-07-31 作者:daque
把软硬件放在数据库里供载入办法: 1;捉鸡 2:放马. 3:数据库里加一个表:access的用.asp的数据库东西径直加;sql的3389进去用sql的企业处置器 也不妨在本人的机子里先做好一个;而后导出 4;无组件上传{和传图片入库的本领一律;网上引见的本领多的是};导出的这步就省了 5:做个.asp的载入页放鸡的站里一个.asp里 6:本人站上放一个框架.....src=....?down=1 俩点题目: 一:每个上传的软硬件胜过30m载入试时不宁静;下不来的功夫多 二:sql库里表中id字段要更加树立自增 做的不好:见笑见笑;第一个尝试的鸡里还让不领会哪位大侠把库里数据删了俩次:呵呵利害 可见asp跷跷板里不加ip辨别码是不行了<%@codepage=936%><%response.buffer=true response.expires=-1 response.expiresabsolute=now()-1 response.expires=0 response.cachecontrol = "no-cache" on error resume next co=request.servervariables("url") session("lp")=session.sessionid dim conn,dbpath set conn=server.createobject("adodb.connection") 'conn.open "provider=sqloledb;datasource=211.151.188.8;uid=sa;pwd=2004;database=ddwen" dbpath=server.mappath("ddwen.asp") conn.open "provider=microsoft.jet.oledb.4.0;data source="&dbpath 'conn.open "driver={microsoft access driver (*.mdb)};dbq="&dbpath%><html><head><meta http-equiv="content-type" content="text/html; charset=utf8"><style>body { font-size: 9pt; color: blue } table { font-size: 9pt; font-family: 宋体 } a { font-size: 9pt; color: blue; font-family: 宋体; text-decoration: none } a:hover { color: red; font-family: 宋体 } input { border-right: blue 1px solid; border-top: blue 1px solid; font-size: 9pt; background: #fff0b2; border-left: blue 1px solid; border-bottom: blue 1px solid; font-family: verdana,arial font-color:blue } </style><title>蓝屏软硬件</title> <script language="javascript"> function popwin2(id,path) {window.open("<%=co%>?id="+id+"&ppath="+path,"","height=450,width=600,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=yes,location=no");} </script> </head><% const maxperpage=10 dim totalput,currentpage,totalpages,i,j,keyword keyword=replace(request("txtitle"),"'","") keyword=replace(keyword,";","") if not isempty(request("page")) then currentpage=cint(request("page")) else currentpage=1 end if dim sql,rs,rstype,typesql,typeid,typename if not isempty(request("typeid")) then typeid=request("typeid") else typeid=1 end if set rstype=server.createobject("adodb.recordset") typesql="select * from soft" rstype.open typesql,conn,1,1 typename=rstype("type") rstype.close%> <table cellspacing=1 cellpadding=1 width=755 align=center border=0 bgcolor=#006666> <tbody> <tr height=20> <td colspan=3 width="300"align=center>==><a title=佳人 href="girl.asp">秀 <a/> <a title=革新 href="<%=request.servervariables("url")%>"> 本文献: <%=request.servervariables("url")%></a></td> <td align="center" width="20%" style="color: #ffff00" bgcolor=#2b77bd height=10> <script language=javascript> today=new date(); function initarray(){ this.length=initarray.arguments.length for(var i=0;i<this.length;i++) this[i+1]=initarray.arguments } var d=new initarray( "礼拜日", "礼拜一", "礼拜二", "礼拜三", "礼拜四", "礼拜五", "礼拜六"); document.write( "<font color=ffff00 style='font-size:10pt;font-family: 宋体'> ", today.getyear(),"年", today.getmonth()+1,"月", today.getdate(),"日 ", d[today.getday()+1], "</font>" ); </script></td> </tr> </tbody> </table> <body> <table border=1 cellpadding=0 cellspacing=0 width=755 bgcolor="#ddee00" align="center"> <tr> <td width="100%" valign="top"> <table border="0" cellpadding="3" cellspacing="0" width="100%"> <tr> <td width="100%" valign="top"> <%sql="select * from soft where sm like '%"&keyword&"%' order by id desc" '提防缺点:.; set rs= server.createobject("adodb.recordset") rs.open sql,conn,1,1 if rs.eof and rs.bof then response.write "<p align='center'>没有或没有找就任何步调</p>" else totalput=rs.recordcount totalput=rs.recordcount if currentpage<1 then currentpage=1 end if if (currentpage-1)*maxperpage>totalput then if (totalput mod maxperpage)=0 then currentpage= totalput \ maxperpage else currentpage= totalput \ maxperpage + 1 end if end if if currentpage=1 then showpage totalput,maxperpage,""&co&"" showcontent showpage totalput,maxperpage,""&co&"" else if (currentpage-1)*maxperpage<totalput then rs.move (currentpage-1)*maxperpage dim bookmark bookmark=rs.bookmark showpage totalput,maxperpage,""&co&"" showcontent showpage totalput,maxperpage,""&co&"" else currentpage=1 showpage totalput,maxperpage,""&co&"" showcontent showpage totalput,maxperpage,""&co&"" end if end if rs.close end if set rs=nothing sub showcontent dim i i=0%> <div align="center"> <center> <table border="1" cellspacing="0" width="97%" cellpadding="0"> <tr bgcolor="#50aac5"> <td width="32" align="center" height="20"><b>id</b></td> <td width="110" align="center"><b>软硬件名{点击载入}</td> <td width="40" align="center"><b>巨细</b></td> <td width="191" align="center"><b>软硬件简介</b></td> <td width="128" align="center"><b>介入日子</b></td> <td width="34" align="center"><b>点击</b></td> </tr> <%do while not rs.eof%> <tr> <td height="23" width="32" bgcolor="#fff0b2"> <p align="center"><%=rs("id")%> </td> <td width="110" bgcolor="#fff0b2"> <p align="center"><form><input name=id type=hidden value=<%=rs("id")%>><input name=dn type=submit value=<%=left(rs("name"),40)%> title=点击载入></td></form> <td width="40" bgcolor="#fff0b2"> <p align="center"><a href=# "javascript:popwin2(<%=rs("id")%>)" title=<%=rs("sm")%>><font color="#000000"><%=rs("size")%></font></a> </td> <td width="191" bgcolor="#fff0b2"> <p align="center"><a href=# "javascript:popwin2(<%=rs("id")%>)" title=<%=rs("sm")%>><font color="#000000"><%=left(rs("sm"),30)%></font></a> </td> <td width="128" bgcolor="#fff0b2"> <p align="center"><font color="red"><i><%=rs("date")%></i></font> </td> <td width="34" bgcolor="#fff0b2"> <p align="center"><%=rs("hits")%> </td> </tr> <%i=i+1 if i>=maxperpage then exit do rs.movenext loop%></table> </center> </div><%end sub function showpage(totalnumber,maxperpage,filename) dim n if totalnumber mod maxperpage=0 then n= totalnumber \ maxperpage else n= totalnumber \ maxperpage+1 end if response.write "<form method=post action="&filename&"?typeid="&typeid&"&txtitle="&keyword&">" response.write "<p align='center'><font color='red'>"&typename&"</font> " if currentpage<2 then response.write "<font color='#000080'>首页 上一页</font> " else response.write "<a href="&filename&"?page=1&typeid="&typeid&"&txtitle="&keyword&">首页</a> " response.write "<a href="&filename&"?page="¤tpage-1&"&typeid="&typeid&"&txtitle="&keyword&">上一页</a> " end if if n-currentpage<1 then response.write "<font color='#000080'>下一页 尾页</font>" else response.write "<a href="&filename&"?page="&(currentpage+1)&"&typeid="&typeid&"&txtitle="&keyword&">" response.write "下一页</a> <a href="&filename&"?page="&n&"&typeid="&typeid&"&txtitle="&keyword&">尾页</a>" end if response.write "<font color='#000080'> 页次:</font><strong><font color=red>"¤tpage&"</font><font color='#000080'>/"&n&"</strong>页</font> " response.write "<font color='#000080'> 共<b>"&totalnumber&"</b>软硬件 <b>"&maxperpage&"</b>软硬件/页</font> " response.write " <font color='#000080'>转到:</font><input type='text' name='page' size=4 maxlength=10 class=smallinput type='text' name='txtitle' value="¤tpage&">" response.write " <input class=buttonface type='submit' value=' goto ' name='cndok'></span></p></form>" end function%> <form name=searchtitle method=post action=<%=co%>> <p align=center>简介: <input class=smallinput type="text" name="txtitle" size="13"> <input class=buttonface type="submit" value="查 询" name="title" style="font-size: 9pt"> </p> </form> </td> </tr> </table> </td> </tr> </table> </body></html><center><!script src="http://192.168.1.9/jishu/new.asp?view=yes"></script><%down=request("dn") if down<>"" then set rs = server.createobject("adodb.recordset") sql="select * from soft where id ="& request("id") rs.open sql,conn,1,3 rs("hits")=rs("hits")+1 rs.update response.clear response.addheader"content-disposition","attachment;filename="&rs("name") response.addheader"content-length",rs("size") response.charset="utf-8" response.contenttype="application/octet-stream" response.binarywrite rs("lp") response.flush response.end rs.close set rs=nothing end if set conn=nothing%>set rs = server.createobject("adodb.recordset") sql="select * from soft where id ="& request("id") rs.open sql,conn,1,3 rs("hits")=rs("hits")+1 rs.update response.clear response.addheader"content-disposition","attachment;filename="&rs("name") response.addheader"content-length",rs("size") response.charset="utf-8" response.contenttype="application/octet-stream" 'response.contenttype = rs("type") 'response.binarywrite rs("rj").getchunk(7500000) ''=========这是径直看图的本领 response.binarywrite rs("lp") response.flush response.end rs.close set rs=nothinghttp://210.51.181.21/db/ddwen.mdb