⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 novelintro.aspx.cs

📁 小说网(c#)版源程序,学习还是不错滴,大家可以下载下来看看.
💻 CS
字号:
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;

public partial class _novelintro : System.Web.UI.Page
{
    protected DataTable table;
    protected void Page_Load(object sender, EventArgs e)
    {
        //显示小说明细
        if (Request.QueryString["topicid"] != null && Regular.IsId(Request.QueryString["topicid"].ToString()))
        {
            DataSet dataset = SqlStore.SqlIntro(int.Parse(Request.QueryString["topicid"].ToString()));
            this.List_Commend.DataSource = dataset.Tables[0];
            this.List_Commend.DataBind();
            table = dataset.Tables[1];
            this.List_Comment.DataSource = dataset.Tables[2];
            this.List_Comment.DataBind();
            this.Hidden_Topicid.Value = table.Rows[0]["topicid"].ToString();
            if (Session.Contents["username"] != null)
                this.Text_Comment.Text = Session.Contents["username"].ToString();
        }
        else
        {
            Response.Write("<div style=\"color:red;margin-top:20px; margin-bottom:20px;text-align:center;\">抱歉,小说ID有误!</div>");
            Response.End();
        }
    }
    protected void Button_Comment_Click(object sender, EventArgs e)
    {
        //访客发表评论
        if (Request.QueryString["topicid"] != null && Regular.IsId(Request.QueryString["topicid"].ToString()) && this.Hidden_Topicid.Value == Request.QueryString["topicid"].ToString())
        {
            string content =Regular.Filtrate( Request.Form["Text_Content"].ToString());
            SqlStore.SqlComment(int.Parse(Hidden_Topicid.Value), (Session.Contents["username"] == null ? "游客" : Session.Contents["username"].ToString()), content, Request.UserHostAddress);
            Response.Redirect(Request.Url.ToString());
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -