当前位置: 首页 > 图文教程 > 网络编程 > ASP > 使用纯粹的asp+语言制作的栏目管理(三)

ASP
ASP连接SQL2005数据库连接代码
ASP程序与SQL存储过程结合使用详解
asp 小偷采集程序原理与常用函数方法
防盗链接ASP函数
asp将table生成excel文件(xls)
asp实现新评论自动发短信提示的代码
asp最简单的生成验证码代码
ASP 常见对象总结(熟悉一下利用以后的开发使用)
ASP UTF-8编码生成静态网页的函数
ASP+FSO生成的网页文件默认编码格式以及转换成UTF-8编码方法
asp Access数据备份,还原,压缩类代码
asp fso操作类
ASP 自动采集实现代码
asp 一些支付接口
ASP 递归调用 已知节点查找根节点的函数
用asp实现读取文件的最后一行的代码
用asp实现的获取文件夹中文件的个数的代码
ASP与Excel结合生成数据表和Chart图的代码
iis7 ASP+Access数据库连接错误
ASP 日期的加减运算实现代码

ASP 中的 使用纯粹的asp+语言制作的栏目管理(三)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 32 ::
收藏到网摘: n/a

  /*
豆腐制作 都是精品
http://www.asp888.net 豆腐技术站
如转载 请保留完整版权信息
*/
呵呵,连续看了几个特别复杂的程序,相信大的脑袋已经和 豆腐 的脑袋差不多 变成了一个大大的。。好吧,最后写个简单简单的程序,我们就算是 作个总结吧!
我们在前面的程序中将我们的栏目的所有的 标题都已经用分页的方法显示出来了,所以我们在这里做上一个把栏目的内容显示出来的程序就可以了,这个程序很简单,大家可以舒服的靠在椅子上来阅读这篇文章
viewarticl.aspx:
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SQL" %>
<script runat=server language="C#">
protected void Page_Load(Object Src, EventArgs E){
int intRecID=Request.QueryString["id"].ToInt16();
SQLDataReader dbRead;
SQLCommand dbComm;
String strSQL;
String strConn;
SQLConnection conn;
Hashtable Cfg=new Hashtable();
Cfg = (Hashtable)Context.GetConfig("appsettings");
strConn=Cfg["Conn"].ToString();
conn = new SQLConnection(strConn);
strSQL="select * from lanmu where id=" + intRecID.ToString();
dbComm=new SQLCommand(strSQL,conn);
dbComm.ActiveConnection.Open();
dbComm.Execute(out dbRead);
if(!dbRead.Read()){
showmsg.Text="对不起,没有编号为" + intRecID.ToString() + "的文章";
return;
}
//HttpServerUtility server=new HttpServerUtility();
showmsg.Text=Server.HtmlEncode(dbRead["content"].ToString());
}
</script>
<html>
<head>
<title>浏览文章__技术专栏__<%=sqlRead("title")%></title>
<%=GrabPage("/inc/head.inc")%>
<link rel="stylesheet" type="text/css" href="/doufu.css">
</head>
<body>
<asp:Label id=showmsg runat=server />
</body>
</html>