资源简介
北极星博客--用asp.net和C#开发的小型博客。不附带数据库,附加AJAX资源
代码片段和文件信息
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 = “很抱歉你的评论发表失败请重新尝试!“;
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 939 2007-11-13 17:45 MyBlog\images\1111.jpg
文件 984 2007-11-13 17:45 MyBlog\images\222.jpg
文件 981 2007-11-13 17:52 MyBlog\images\333.jpg
文件 47383 2007-11-12 16:17 MyBlog\images\7000111.jpg
文件 1542 2007-08-29 11:22 MyBlog\images\exit.jpg
文件 957 2007-11-14 11:45 MyBlog\images\exitlogin.jpg
文件 981 2007-11-13 17:52 MyBlog\images\finish.jpg
文件 939 2007-11-13 17:45 MyBlog\images\login.jpg
文件 984 2007-11-13 17:45 MyBlog\images\reg.jpg
文件 1759 2007-08-29 11:22 MyBlog\images\register.gif
文件 10430 2007-11-13 17:11 MyBlog\images\st
..A.SH. 32256 2007-11-14 11:39 MyBlog\images\Thumbs.db
文件 16036 2007-11-13 16:21 MyBlog\images\top.jpg
文件 124385 2007-11-13 17:13 MyBlog\images\top.png
文件 860 2007-08-29 10:58 MyBlog\images\topleft.gif
文件 120 2007-08-29 10:58 MyBlog\images\topright.gif
目录 0 2008-12-14 07:50 MyBlog\images
文件 5372 2007-12-20 17:29 MyBlog\MasterPage.html
文件 1090 2008-01-15 13:15 MyBlog\MyBlog\MyBlog\App_Code\CommonHandler.cs
目录 0 2008-12-14 07:50 MyBlog\MyBlog\MyBlog\App_Code
目录 0 2008-12-14 07:50 MyBlog\MyBlog\MyBlog\App_Data
文件 3639 2007-11-19 16:02 MyBlog\MyBlog\MyBlog\article.aspx
文件 2615 2008-01-15 13:22 MyBlog\MyBlog\MyBlog\article.aspx.cs
文件 3072 2007-11-14 16:54 MyBlog\MyBlog\MyBlog\Bin\App_Licenses.dll
文件 61440 2007-11-07 11:22 MyBlog\MyBlog\MyBlog\Bin\AspNetPager.dll
文件 40 2007-11-19 20:46 MyBlog\MyBlog\MyBlog\Bin\AspNetPager.dll.refresh
文件 753664 2006-07-18 20:21 MyBlog\MyBlog\MyBlog\Bin\FreeTextBox.dll
文件 16384 2008-12-03 16:32 MyBlog\MyBlog\MyBlog\Bin\MyBlogBLL.dll
文件 17920 2008-12-03 16:32 MyBlog\MyBlog\MyBlog\Bin\MyBlogBLL.pdb
文件 24576 2008-12-03 16:32 MyBlog\MyBlog\MyBlog\Bin\MyBlogDAL.dll
............此处省略115个文件信息
评论
共有 条评论