?? show.asp
字號:
<!--#include file = "Startup.asp"-->
<!--#include file = "../../Include/DeCode.asp"-->
<%
' ======================
' 功能:顯示新聞
' 描述:顯示編輯的內(nèi)容頁,此頁注意一下DeCode接口函數(shù)的調(diào)用。
' ======================
Call Header("顯示新聞內(nèi)容")
Call Content()
Call Footer()
' 本頁內(nèi)容區(qū)
Sub Content()
' 傳入?yún)?shù):新聞ID
Dim sNewsID
sNewsID = Trim(Request("id"))
' 新聞ID有效性驗證,防止有些人惡意的破壞此演示程序
If IsNumeric(sNewsID) = False Then
GoError "請通過頁面上的鏈接進行操作,不要試圖破壞此演示系統(tǒng)。"
End If
' 從數(shù)據(jù)庫中取初始值
Dim sTitle, sContent, sPicture, sOriginalFileName, sSaveFileName, sSavePathFileName
sSql = "SELECT * FROM NewsData WHERE D_ID=" & sNewsID
oRs.Open sSql, oConn, 0, 1
If Not oRs.Eof Then
sTitle = oRs("D_Title")
sContent = oRs("D_Content")
sPicture = oRs("D_Picture")
sOriginalFileName = oRs("D_OriginalFileName")
sSaveFileName = oRs("D_SaveFileName")
sSavePathFileName = oRs("D_SavePathFileName")
Else
GoError "無效的新聞ID,請點頁面上的鏈接進行操作!"
End If
oRs.Close
' 禁用某些標簽,如出于安全考慮的Script標簽,等
' 要使用此功能需要先包含"Include/DeCode.asp"文件。
' 此例只過濾SCRIPT標簽,即意味著內(nèi)容中的客戶端腳本不會生效,您可根據(jù)實際的需要加入其它標簽。
' 當前支持過濾的標簽,可以查看DeCode.asp文件中的說明。
sContent = eWebEditor_DeCode(sContent, "SCRIPT")
' 輸出新聞
Response.Write "<table border=0 cellpadding=5 width='90%' align=center>" & _
"<tr><td align=center><b>" & sTitle & "</b></td></tr>" & _
"<tr><td>" & sContent & "</td></tr>" & _
"</table>"
' 輸出相關(guān)文件信息
Response.Write "<p><b>此新聞的相關(guān)上傳文件信息如下:</b></p>"
' 把帶"|"的字符串轉(zhuǎn)為數(shù)組,用于列出顯示
Dim aOriginalFileName, aSaveFileName, aSavePathFileName
aOriginalFileName = Split(sOriginalFileName, "|")
aSaveFileName = Split(sSaveFileName, "|")
aSavePathFileName = Split(sSavePathFileName, "|")
Response.Write "<table border=1 cellpadding=3 cellspacing=0>" & _
"<tr>" & _
"<td>序號</td>" & _
"<td>原文件名(接口:d_originalfilename)</td>" & _
"<td>保存文件名(接口:d_savefilename)</td>" & _
"<td>保存路徑文件名(接口:d_savepathfilename)</td>" & _
"</tr>"
Dim i
For i = 0 To UBound(aOriginalFileName)
Response.Write "<tr>" & _
"<td>" & CStr(i + 1) & "</td>" & _
"<td>" & aOriginalFileName(i) & "</td>" & _
"<td>" & aSaveFileName(i) & "</td>" & _
"<td>" & aSavePathFileName(i) & "</td>" & _
"</tr>"
Next
Response.Write "</table>"
End Sub
%>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -