-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComment.aspx.cs
More file actions
80 lines (66 loc) · 2.13 KB
/
Copy pathComment.aspx.cs
File metadata and controls
80 lines (66 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
using System;
using System.Data;
using System.Configuration;
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 _211;
public partial class Comment : System.Web.UI.Page
{
string action = string.Empty;
string id = string.Empty;
string page = string.Empty;
string pagehtml = string.Empty;
string linkhtml = string.Empty;
int Pages = 5;
string commentparentid = string.Empty;
string commentuser = string.Empty;
string commenttext = string.Empty;
string commentvalidate = string.Empty;
public Comment()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
protected void Page_Load(object sender, EventArgs e)
{
action = Request.Params["action"];
id = Request.Params["id"];
page = Request.Params["page"];
commentparentid = Request.Params["commentparentid"];
commentuser = Request.Params["commentuser"];
commenttext = Request.Params["commenttext"];
commentvalidate = Request.Params["commentvalidate"];//51^aspx
if (action == "ajax_getcomment")
{
ajax_getcomment(id, Int32.Parse(page));
}
else if (action == "ajax_sendcomment")
{
if (Session["VerifyCode"].ToString().ToLower() != commentvalidate.ToLower())
{
Response.Write("ERROR!");
}
else
{
DBQuery.ExecuteScalar("insert into comment(commentparentid,commentuser,commenttext,commentreply,commentip) values('" + commentparentid + "','" + commentuser + "','" + Server.HtmlEncode(commenttext) + "','','" + Request.ServerVariables["REMOTE_ADDR"] + "')");
Response.Write("评论发表成功!");
}
}
else
{
Response.Write("error!");
}
}
private void ajax_getcomment(string id, int page)
{
using (CommentBO cm = new CommentBO(id, page - 1))
{
Response.Write(cm.getCommentContent());
}
}
}