📄 reviewshow.aspx
字号:
<%@ Page Language="VB" ContentType="text/html" debug="true"%>
<%@ Import Namespace="System.Data"%>
<%@ Import Namespace="System.Data.OleDb"%>
<%@ Register TagPrefix="mynews" TagName="top" src="ascx/top.ascx"%>
<%@ Register TagPrefix="mynews" TagName="end" src="ascx/end.ascx"%>
<html>
<head>
<title>新闻评论</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
body {COLOR: #000000; FONT-SIZE: 14px}
td {COLOR: #000000; FONT-SIZE: 14px}
A:link{Color:#4455aa},A:active,A:visited{TEXT-DECORATION:none ;Color:#000000}
A:hover{TEXT-DECORATION: underline;Color:#4455aa}
td.TopLighNav1
{
background-image: url(pic/tabs_m_tile.gif);
}
.tableBorder1
{
width:50%;
border: 1px #0099FF solid;
background-color: #ffffff;
}
</style>
</head>
<body>
<mynews:top runat="server"/>
<table width="50%" align="center" cellpadding="0" cellspacing="0" class="tableBorder1">
<tr>
<td align="center" class="TopLighNav1"><asp:label ID="title" runat="server"/></td>
</tr>
<tr>
<td align="right">作者:<a href="mailto:<%=email%>"><asp:label ID="author" runat="server"/></a></td>
</tr>
<tr>
<td><%=content%></td>
</tr>
</table>
<mynews:end runat="server"/>
</body>
</html>
<script language="VB" runat="server">
Dim sql,email,content as string
Dim newsid as integer
Dim myConn as OleDbConnection
Dim myCmd as OleDbCommand
function getdatareader(sql as string) as OleDbDataReader
myCmd=new OleDbCommand(sql,myConn)
myConn.open()
getdatareader=myCmd.ExecuteReader()
end function
function changecode(str as string)
if len(str)>0 then
str = Replace(str, CHR(32), " ")
str = Replace(str, CHR(9), " ")
str = Replace(str, CHR(34), """)
str = Replace(str, CHR(39), "'")
str = Replace(str, CHR(13), "")
str = Replace(str, CHR(10) & CHR(10), "</P><P>")
str = Replace(str, CHR(10), "<BR> ")
return str
end if
end function
Sub Page_Load(sender As Object, e As EventArgs)
Dim strConn as string
strConn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&server.MapPath("./")&"data/news.mdb"
myConn=new OleDbConnection(strConn)
if not page.ispostback then
newsid=Page.request("reviewid")
sql="select ReViewTitle,Content,Author,Email from ReView where ReviewID="& newsid
Dim Reader as OleDbDataReader=getdatareader(sql)
while Reader.read()
title.text=Reader.Item(0)
content=changecode(Reader.Item(1))
author.text=Reader.Item(2)
email=Reader.Item(3)
end while
myConn.close()
end if
end sub
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -