📄 newshow.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="review" src="ascx/review.ascx"%>
<%@ Register TagPrefix="mynews" TagName="special" src="ascx/speciallist.ascx"%>
<%@ Register TagPrefix="mynews" TagName="end" src="ascx/end.ascx"%>
<html>
<head>
<title>新闻:<%=session("newstitle")%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<style type="text/css">
body {COLOR: #000000; FONT-SIZE: 14px}
td {COLOR: #000000; FONT-SIZE: 14px}
.a { color: #9A1B1B}
a:hover { color: #9A1B1B}
a:link {color: #9A1B1B; text-decoration:none}
a:visited { color: #9A1B1B; text-decoration:none}
..cnav { color: #9A1B1B}
a.cnav:hover { color: #9A1B1B}
a.cnav:link {color: #9A1B1B; text-decoration:none}
a.cnav:visited { color: #9A1B1B; text-decoration:none}
..location { color: #0000}
a.location:hover { color: #000000}
a.location:link {color: #000000; text-decoration:none}
a.location:visited { color: #000000; text-decoration:none}
..tomg { color: black; font-size:15px}
a.tomg:hover { color: #FF0000}
a.tomg:link {color: black; text-decoration:none}
a.tomg:visited { color: black; text-decoration:none}
</style>
<body>
<form runat="server">
<mynews:top runat="server"/>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="70%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><font color="#009900"><b>
<asp:label ID="title" runat="server"/>
</b></font></td>
</tr>
<tr>
<td align="center">作者:<asp:label ID="author" runat="server"/> 更新时间:<asp:label ID="updatetime" runat="server"/></td>
</tr>
<tr>
<td><asp:label ID="content" runat="server"/></td>
</tr>
<tr>
<td align="right">源自:<asp:label ID="original" runat="server"/></td>
</tr>
<tr>
<td><mynews:review runat="server"/></td>
</tr>
</table></td>
<td align="center" valign="top" nowrap><mynews:special runat="server"/>
</td>
</tr>
</table>
<mynews:end runat="server"/>
</form>
</body>
</html>
<script language="VB" runat="server">
Dim sql,newstitle,part1,part2 as String
Dim newsno as Integer
Dim myconn as OleDbConnection
Dim myCmd,newscmd 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> ")
str=replace(str,"[img]","<img src='")
str=replace(str,"[/img]","'>")
str=replace(str,"[b]","<b>")
str=replace(str,"[/b]","</b>")
str=replace(str,"[em]","<em>")
str=replace(str,"[/em]","</em>")
str=replace(str,"[u]","<u>")
str=replace(str,"[/u]","</u>")
str=replace(str,"[center]","<center>")
str=replace(str,"[/center]","</center>")
str=replace(str,"[mail]","<a href='mailto:")
str=replace(str,"[url]","<a href='")
str=replace(str,"[|mail]","'>")
str=replace(str,"[|url]","'>")
str=replace(str,"[/hyper]","</a>")
str=replace(str,"[upimg]","<img src=upload/")
str=replace(str,"[/upimg]",">")
part1=left(str,instr(str,">"))
part2=right(str,(len(str)-instr(str,">")))
part1+="<IFRAME SRC='ad.aspx?weizhi=1' SCROLLING='no' WIDTH='360' HEIGHT='300' FRAMEBORDER='0' ALIGN='left'>广告:d_text</IFRAME>"
str=part1+part2
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
newsno=Page.request("newsid")
sql="select Title,Author,UpdateTime,Original,Content from News where NewsID="&newsno
dim reader as OleDbDataReader=getdatareader(sql)
while reader.read()
session("newstitle")=reader.Item(0)
title.text=reader.Item(0)
author.text=reader.Item(1)
updatetime.text=reader.Item(2)
content.text=changecode(reader.Item(4))
original.text=reader.Item(3)
end while
myConn.close()
end if
End Sub
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -