default.asp '下面就是本站首頁顯示的樣本程序:http://asp.on.net.cn/ '適用與本站所有的首頁顯示程序。 <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>ASP動感在線 http://ASP.on.net.cn</title> <link rel="stylesheet" type="text/css" href="css/style.css"> </head> <body bgcolor="#FFFFFF"> <div align="center"> <p>首頁模板!最新5條信息!</p> <table width="60%" cellpadding="0" cellspacing="0" align="center"> <tr> <td width="60%" valign="top" height="54"> <table width="100%" border="1" cellspacing="0" cellpadding="0" align="center" bordercolorlight="#000000" bordercolordark="#FFFFFF"> <tr> <td height="5"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="2" height="8"><% dim conn dim connstr
on error resume next connstr="DBQ="+server.mappath("/new/new.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" set conn=server.createobject("ADODB.CONNECTION") conn.open connstr dim sql dim rs sql="select top 5 * from learning order by articleid desc" Set rs= conn.execute(sql)
if rs.eof and rs.bof then response.write "<p align='center'> 還 沒 有 任 何 文 章</p>" else %><%do while not rs.eof%><font color="#000099">○</font> <a href="<%=rs("url")%>" target="_blank"><%=rs("title")%></a> <i><font color="#FF0000">(<%=rs("dateandtime")%>)</font></i><br> <%=rs("content")%><br> <% rs.movenext loop rs.close end if
set rs=nothing conn.close set conn=nothing %> </td> </tr> <tr> <td colspan="2"> <div align="right"><a href="new/index.asp">以前公告>></a></div> </td> </tr> </table> </td> </tr> </table> <div align="center"> </div> </td> </tr> </table>
</div> </body> </html>
作者:阿喔 出處:<ASP動感在線> http://asp.on.net.cn/
(出處:熱點網(wǎng)絡(luò))
|