discuss.aspx.cs
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
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 System.Data.OleDb;
public partial class discuss : System.Web.UI.Page
{
DB dbobj = new DB();
Bind bind = new Bind();
comman com = new comman();
protected void Page_Load(object sender, EventArgs e)
{
lblmsg.Text = "";
if (!IsPostBack)
{
OleDbConnection con0 = dbobj.GetConnection();
con0.Open();
string sql0 = "select top 1 * from liuyan order by times desc";
OleDbCommand cmd0 = new OleDbCommand(sql0, con0);
OleDbDataReader dr0 = cmd0.ExecuteReader();
if (dr0.Read())
{
lblhuati.Text = dr0["title"].ToString();
}
con0.Close();
}
ShowData();
}
protected void Button1_Click(object sender, EventArgs e)
{
try
{
if (txtliuyan.Text.Trim() == "")
{
lblmsg.Text = "请填写留言内容!";
}
else
{
string insertsql = "insert into liuyan(title,username,contents) values('" + lblhuati.Text + "','" + txtname.Text.Trim() + "','" + txtliuyan.Text.Trim() + "')";
com.runsql(insertsql);
}
ShowData();
}
catch
{
lblmsg.Text = "留言失败!";
后面还有 58 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。