📄 pingding.aspx.cs
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
namespace free.bbs
{
/// <summary>
/// Summary description for pingding.
/// </summary>
public partial class pingding : System.Web.UI.Page
{
protected System.Data.SqlClient.SqlConnection myconn;
protected System.Data.SqlClient.SqlCommand mycomm;
SqlDataReader myread;
protected void Page_Load(object sender, System.EventArgs e)
{
myconn=new SqlConnection(Session["str_connection"].ToString());
myconn.Open();
//zhuti.Text=Session["zhuti"].ToString();
try
{
if(Request.Cookies["free_huiyuan"].Value.ToString()!="free911")
{
try
{
string ans=Request.Params["ancestor_id"];
mycomm=new SqlCommand("select neirong from ancestor where (ancestor_id="+Request.Params["ancestor_id"]+" and banzhu='"+Request.Cookies["free_huiyuan"].Value.ToString()+"')",myconn);
myread=mycomm.ExecuteReader();
try
{
myread.Read();
string he=myread["neirong"].ToString().Trim();
myread.Close();
}
catch
{
myread.Close();
Response.Write("<script>alert('你无权评定该主题')</script>");
Response.Write("<script>window.close()</script>");
}
}
catch
{
Response.Write("<script>alert('你无权评定该主题')</script>");
Response.Write("<script>window.close()</script>");
}
}
}
catch
{
Response.Write("<script>alert('你无权评定该主题')</script>");
Response.Write("<script>window.close()</script>");
}
myconn.Close();
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
}
#endregion
protected void Button2_Click(object sender, System.EventArgs e)
{
Response.Write("<script>window.close()</script>");
}
protected void Button1_Click(object sender, System.EventArgs e)
{
string sqlstr;
if(RadioButtonList1.SelectedValue=="1")
sqlstr="update posts set isceam=2,islock=0 where postid="+Request.Params["post_id"]+"";
else if(RadioButtonList1.SelectedValue=="2")
sqlstr="update posts set islock=1 where postid="+Request.Params["post_id"]+"";
else if(RadioButtonList1.SelectedValue=="3")
sqlstr="update posts set isfix=2,islock=0 where postid="+Request.Params["post_id"]+"";
else
sqlstr="update posts set isfix=1,islock=0 where postid="+Request.Params["post_id"]+"";
mycomm=new SqlCommand(sqlstr,myconn);
mycomm.Connection.Open();
try
{
mycomm.ExecuteNonQuery();
Response.Write("<script>alert('评定成功')</script>");
Response.Write("<script>window.close()</script>");
}
catch
{
Response.Write("<script>alert('评定失败')</script>");}
mycomm.Connection.Close();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -