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

ASP
用ASP编写网络传呼机
用ASP+CSS实现随机背景
ASP下载系统防盗链方法
用ASP编写下载网页中所有资源的程序
Request.ServerVariables应用
解决Asp程序的Server.CreateObject错误
ASP实现TCP端口扫描的方法
源码实例:ASP实现远程保存图片
用ASP+DLL实现WEB方式修改服务器时间
ASP使用MySQL数据库全攻略
ASP+SQL Server构建网页防火墙
教程/ASP 十天学会ASP之第二天
教程/ASP 十天学会ASP之第四天
教程/ASP 十天学会ASP之第五天
教程/ASP 十天学会ASP之第六天
教程/ASP 十天学会ASP之第七天
教程/ASP 十天学会ASP之第八天
教程/ASP 十天学会ASP之第九天
教程/ASP 十天学会ASP之第十天
关于学习ASP和编程的28个观点

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 26 ::
收藏到网摘: 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>