• <label id="pxtpz"><meter id="pxtpz"></meter></label>
      1. <span id="pxtpz"><optgroup id="pxtpz"></optgroup></span>

        當前位置:雨林木風下載站 > 技術開發教程 > 詳細頁面

        一個技巧完善的專欄管理的程序->這是asp.net的第二個應用(4)

        一個技巧完善的專欄管理的程序->這是asp.net的第二個應用(4)

        更新時間:2021-11-16 文章作者:未知 信息來源:網絡 閱讀次數:

        一個功能完善的專欄管理的程序->這是asp.net的第二個應用(四)
        /*
        豆腐制作,都是精品
        http://www.asp888.net 豆腐技術站
        如轉載,請保留完整版權信息
        */
        我們首先來按照欄目的類別來顯示欄目的所有文章,當然一個分頁的程序是非常關鍵的,我們還是來用我們在 留言版 中用到的 那個分頁的程序,過幾天 我會把這個作成一個pagelet 的,大家趕快鼓勵我吧!

        showarticle.aspx:
        <!--#include file="func.aspx"-->
        <html>
        <head>
        <title>瀏覽文章</title>
        <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
        <meta name="Description" Content="探討ASp,Php 編程,介紹Visual Basic ,Visual C++
        等業界最新技術 并提供 免費的各種服務 包括 免費統計系統,免費調查
        并提供 招聘站點和 同學錄 的服務">
        <meta name="Keywords" Content="探討ASp,Php 編程,介紹Visual Basic ,Visual C++
        等業界最新技術 并提供 免費的各種服務 包括 免費統計系統,免費調查
        并提供 招聘站點和 同學錄 的服務">
        <link REL="SHORTCUT ICON" href="http://www.asp888.net/site.ico">
        <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
        <link rel="stylesheet" type="text/css" href="/doufu.css">
        </head>
        <body>
        <!--廣告開始-->
        <img src=http://www.okasp.com/techinfo/"images/banner.gif">
        <!--廣告結束-->
        <%
        dim strClassid as string
        dim conn as SQLConnection
        dim sqlCmd as SQLCommand
        dim sqlRead as SQLDataReader
        dim strSQL as string
        dim intLen as integer
        dim intRecCount as integer

        strClassid=request.querystring("classid")
        conn=GetConn()
        strSQL="select count(*) from lanmu where classid=" & strClassid & ""
        sqlCmd=new SQLCommand(strSQL,conn)
        sqlCmd.ActiveConnection.Open()
        sqlCmd.Execute(sqlRead)
        sqlCmd.ActiveConnection.Close()
        sqlRead.Read()
        if cInt(sqlRead(0))=0 then
        response.write("對不起,當前這個欄目沒有內容")
        response.end
        end if
        intRecCount=sqlRead(0)
        strSQL="select * from lanmu,lanmuclass where lanmu.classid=lanmuclass.classid and lanmu.classid=" & strClassID & " and lanmu.isuse='1' order by id desc"
        sqlCmd=new SQLCommand(strSQL,conn)
        sqlCmd.ActiveConnection.Open()
        sqlCmd.Execute(sqlRead)


        '處理分頁顯示

        dim intPageCount as integer
        dim intStart as integer

        if isNumeric(request.querystring("start")) then
        intStart=Cint(request.querystring("start")) '本頁數據起使位置
        else
        intStart=0
        end if

        intLen=10 '每頁需要顯示的數據數量
        '以下計算 當前的 記錄的分頁頁數
        if (intRecCount mod intLen)=0 then
        intPageCount=intRecCount/intLen
        else
        intPageCount=(intRecCount-(intRecCount mod intLen))/intLen+1
        end if
        dim i as integer
        '將得到的sqlRead向后移動 start 指定的 位置
        for i=0 to intStart-1
        sqlRead.read()
        next
        '顯示table 分頁Bar
        WritePage(intStart,"showarticle.aspx",intLen ,intPageCount ,intRecCount )
        %>
        <table border=1 width=100%>
        <tr>
        <td width=10% align=center>編號</td>
        <td width=50% nowrap>主題</td>
        <td width=25% align=center>作者</td>
        <td width=25% align=center>閱讀次數</td>
        </tr>
        <%
        for i=0 to intLen-1
        atEnd=sqlRead.read()
        if not atEnd then exit for%>
        <tr>
        <td align=center><%=sqlRead("id")%></td>
        <td><a href="viewArticle.aspx?id=<%=sqlRead("id")%>"><%=sqlRead("title")%></a></td>
        <td align=center><%=sqlRead("userid")%></td>
        <td align=center><%=sqlRead("viewnum")%></td>
        </tr>
        <%next%>
        </table>
        <p></p>
        </body>
        </html>
        這個程序沒有什么說的,我們看看就可以了。如果有什么看不懂的地方,別著急,再看看下面的這個程序:)
        viewarticle.aspx 文件是用來查看具體的某一篇文章的,因為時間的關系,我沒有把這個程序的評論和打分的
        功能添加上,哎!我也很傷心,等到以后吧!
        viewarticle.aspx
        <!--#include file="func.aspx"-->
        <%

        dim conn as SQLCOnnection
        dim sqlRead as SQLDataReader
        dim sqlCmd as SQLCommand
        dim strSQL as string
        dim strID as string
        conn=getConn()
        strID=request.querystring("id")
        strSQL="select * from lanmu,lanmuclass where lanmu.classid=lanmuclass.classid and lanmu.id=" & strID & ""
        sqlCmd=new SQLCommand(strSQL,conn)
        sqlCmd.ActiveConnection.Open()
        sqlCmd.Execute(sqlRead)
        if not sqlRead.Read() then
        '沒有留言信息
        echoErr("對不起,當前這個欄目還沒有內容")
        end if
        %>
        <html>
        <head>
        <title>瀏覽文章__技術專欄__<%=sqlRead("title")%></title>
        <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
        <meta name="Description" Content="探討ASp,Php 編程,介紹Visual Basic ,Visual C++
        等業界最新技術 并提供 免費的各種服務 包括 免費統計系統,免費調查
        并提供 招聘站點和 同學錄 的服務">
        <meta name="Keywords" Content="探討ASp,Php 編程,介紹Visual Basic ,Visual C++
        等業界最新技術 并提供 免費的各種服務 包括 免費統計系統,免費調查
        并提供 招聘站點和 同學錄 的服務">
        <link REL="SHORTCUT ICON" href="http://www.asp888.net/site.ico">
        <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
        <link rel="stylesheet" type="text/css" href="/doufu.css">
        </head>
        <body>
        <!--廣告開始-->
        <img src=http://www.okasp.com/techinfo/"images/banner.gif">
        <!--廣告結束-->

        <p>當前所在位置--<a href="/">豆腐技術站</a>__<a href="/lanmu">技術專欄</a>__<a href="showArticle.asp?classid=<%=sqlRead("Classid")%>"><%=sqlRead("classname")%></a></font></p>
        <center><font color=gray>這篇文章已經被閱讀</font><font color=red><%=sqlRead("viewnum")+1%></font><font color=gray>次</font></center>
        <p><%=replace((server.HTMLEncode(sqlRead("content"))),chr(13),"<br>")%></p>
        <table width=100%>
        <tr>
        <td width=100% align=right>作者:<%=sqlRead("userid")%>(<%=sqlRead("selFrom")%>)</td>
        </tr>
        <tr>
        <td width=100% align=right>添加時間:<%=sqlRead("dtime")%></td>
        </tr>
        </table>
        <p>
        </body>
        </html>
        <%response.end%>

        <script language="VB" runat=server>
        sub EchoErr(strErr as string)
        response.write("<html>")
        response.write("<head>")
        response.write("<title>瀏覽文章</title>")
        response.write(grabPage("/inc/head.inc"))
        response.write("<link rel='stylesheet' type='text/css' href='/doufu.css'>")
        response.write("</head>")
        response.write("<body>")
        response.write(strErr)
        response.write("</body></html>")
        response.end
        end sub
        </script>
        哎,純粹的 asp 代碼,我都有些忍不住了,但是的確是 這樣,asp.net 對于初學者來說,他的門檻并不高,我會在 以后不長的時間,等到大家都已經認為已經入門以后,推出這個系列文章的下一個版本,那個時候將使用純粹的asp.net 的代碼,不過話又 說回來,用什么方法不重要,只不過是我們對自己的要求而已,asp.net正是因為他可以使 asp 的程序員 很輕松的升級到asp+,我們才說,他真牛!

        溫馨提示:喜歡本站的話,請收藏一下本站!

        本類教程下載

        系統下載排行

        主站蜘蛛池模板: 亚洲一级二级三级不卡| 亚洲精品国偷自产在线| 亚洲熟妇无码AV不卡在线播放| 午夜精品一区二区三区免费视频 | 亚洲字幕AV一区二区三区四区 | 免费视频精品一区二区三区 | 亚洲伊人色一综合网| 亚洲天堂免费在线| 亚洲一区二区三区高清在线观看 | 免费无遮挡无码永久在线观看视频| 亚洲性无码AV中文字幕| 国产色爽免费视频| yellow视频免费看| 亚洲国产精品无码成人片久久| 久久精品电影免费动漫| 亚洲精品免费在线视频| 好爽又高潮了毛片免费下载| 国产成人久久精品亚洲小说| 精品国产亚洲一区二区在线观看| 三年片免费观看大全国语| 亚洲人成电影在在线观看网色| 中文字幕无码播放免费| 亚洲国产综合AV在线观看| 亚洲国产婷婷香蕉久久久久久| 永久免费av无码网站yy| 亚洲免费视频观看| 亚洲国产成人精品无码久久久久久综合 | 亚洲小说图片视频| 日本一线a视频免费观看| 久久精品无码免费不卡| 久久久久亚洲AV无码专区首JN| 成人片黄网站色大片免费| xxxx日本在线播放免费不卡| 日韩亚洲AV无码一区二区不卡| 免费无码又爽又高潮视频| 久青草视频97国内免费影视| 亚洲国产精品张柏芝在线观看 | 亚洲高清在线视频| 免费鲁丝片一级在线观看| 三级黄色免费观看| 亚洲色中文字幕在线播放|