资源简介
此资源为个人的简单博客,虽简单,但是功能基本都实现了,实现了网站的基本三层架构。
代码片段和文件信息
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using MyBlogModels;
using MyBlogBLL;
public partial class article : System.Web.UI.Page
{
protected void Page_Load(object sender EventArgs e)
{
if (!IsPostBack)
{
try
{
int id = Convert.ToInt32(Request.QueryString[“aid“]);
Article article = ArticleManager.GetArticleById(id);
article.Clicks += 1;
if (article == null || article.Equals(null))
{
this.Page.title = “此文章不存在或被管理员删除请见谅“ ;
this.lblcontent.Text = “此文章不存在或被管理员删除请见谅!“;
}
else
{
this.lbltitle.Text = article.title;
this.Page.title = article.title;
this.lblposttime.Text = article.PubDate.ToString();
this.lblcontent.Text = article.Contents;
article.Clicks += 1;
ArticleManager.ModifyArticle(article);
}
}
catch
{
Response.Redirect(“refresh.aspx?msg=“ + “此文章不存在或被管理员删除请见谅!“);
}
}
}
protected void btnCommit_ServerClick(object sender EventArgs e)
{
int id = Convert.ToInt32(Request.QueryString[“aid“]);
Article article = ArticleManager.GetArticleById(id);
string commentContent = Server.HtmlEncode(this.txtComment.Text.ToString());
if (commentContent.Length > 250)
{
commentContent = commentContent.Substring(0 250);
}
Comment comment = new Comment();
comment.Article = article;
comment.AuthorName = this.txtCommentName.Text.ToString();
comment.Contents = commentContent;
comment.PubDate = DateTime.Now;
if (CommentManager.AddComment(comment) != null)
{
Response.Redirect(“article.aspx?aid=“ + id);
Response.Write(“alert(\“恭喜您,评论发表成功!\“)“);
}
else
{
this.lblErrorComment.Text = “很抱歉你的评论发表失败请重新尝试!“;
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1930 2009-05-04 11:00 BeijixingBlog\51aspx源码必读.txt
文件 3145728 2009-07-17 09:31 BeijixingBlog\DB_51aspx\myBlog.mdf
文件 1048576 2009-05-04 11:08 BeijixingBlog\DB_51aspx\myBlog_log.ldf
文件 4945 2007-07-18 09:38 BeijixingBlog\from.gif
文件 1090 2008-01-15 13:15 BeijixingBlog\MyBlog\App_Code\CommonHandler.cs
文件 3639 2007-11-19 16:02 BeijixingBlog\MyBlog\article.aspx
文件 2615 2009-04-21 08:44 BeijixingBlog\MyBlog\article.aspx.cs
文件 3072 2007-11-14 16:54 BeijixingBlog\MyBlog\Bin\App_Licenses.dll
文件 61440 2007-11-07 11:22 BeijixingBlog\MyBlog\Bin\AspNetPager.dll
文件 40 2007-11-19 20:46 BeijixingBlog\MyBlog\Bin\AspNetPager.dll.refresh
文件 753664 2006-07-18 20:21 BeijixingBlog\MyBlog\Bin\FreeTextBox.dll
文件 5632 2009-07-17 09:34 BeijixingBlog\MyBlog\Bin\MyBlogBLL.dll
文件 24064 2009-07-17 09:34 BeijixingBlog\MyBlog\Bin\MyBlogBLL.pdb
文件 13824 2009-07-17 09:34 BeijixingBlog\MyBlog\Bin\MyBlogDAL.dll
文件 38400 2009-07-17 09:34 BeijixingBlog\MyBlog\Bin\MyBlogDAL.pdb
文件 6656 2009-07-17 09:34 BeijixingBlog\MyBlog\Bin\MyblogModels.dll
文件 28160 2009-07-17 09:34 BeijixingBlog\MyBlog\Bin\MyblogModels.pdb
文件 1274 2009-05-04 10:59 BeijixingBlog\MyBlog\Default.aspx
文件 1240 2009-05-04 10:56 BeijixingBlog\MyBlog\Default.aspx.cs
文件 939 2007-11-13 17:45 BeijixingBlog\MyBlog\images\1111.jpg
文件 984 2007-11-13 17:45 BeijixingBlog\MyBlog\images\222.jpg
文件 47383 2007-11-12 16:17 BeijixingBlog\MyBlog\images\7000111.jpg
文件 970 2007-11-14 17:48 BeijixingBlog\MyBlog\images\cancel.jpg
文件 1542 2007-08-29 11:22 BeijixingBlog\MyBlog\images\exit.jpg
文件 957 2007-11-14 11:45 BeijixingBlog\MyBlog\images\exitlogin.jpg
文件 981 2007-11-13 17:52 BeijixingBlog\MyBlog\images\finish.jpg
文件 1012 2007-08-29 10:58 BeijixingBlog\MyBlog\images\finish1.gif
文件 4945 2007-07-18 09:38 BeijixingBlog\MyBlog\images\from.gif
文件 939 2007-11-13 17:45 BeijixingBlog\MyBlog\images\login.jpg
文件 990 2007-11-14 17:48 BeijixingBlog\MyBlog\images\post.jpg
............此处省略108个文件信息
评论
共有 条评论