viewgames.aspx.cs

(开头部分) 2KB

这里只显示每个文件的开头 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;
using System.Text.RegularExpressions;

public partial class viewgames : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            OleDbConnection conn = dbcon.createconnection();
            conn.Open();
            string id = Request.QueryString["id"].ToString();
            string strSql = "select * from gamenews where newid=@id";
            OleDbParameter Sid = new OleDbParameter("@id", OleDbType.Numeric);
            Sid.Value = id;
            OleDbCommand com = new OleDbCommand(strSql, conn);
            com.Parameters.Add(Sid);
            try
            {
                OleDbDataReader dr = com.ExecuteReader();
                if (dr.Read())
                {
                    labtitle.Text = dr["title"].ToString();
                    labdate.Text = dr["adddate"].ToString();
                    labcontent.Text = dr["content"].ToString();
                    lably.Text = dr["ly"].ToString();
                    labcount.Text = dr["counts"].ToString();
                }
                dr.Close();
                dr.Dispose();
                OleDbParameter ssid = new OleDbParameter("@id", OleDbType.Numeric);
                ssid.Value = id;
                OleDbCommand mycom = new OleDbCommand("update gamenews set counts=counts+1 where newid=@id", conn);
                mycom.Parameters.Add(ssid);
                mycom.ExecuteNonQuery();
            }
            catch
            {
                labtitle.Text = "对不起,没有此条记录!";
                labdate.Text = "";
                labcontent.Text = "";
                lably.Text = "";
                labcount.Text = "";
            }
            finally
            {
                conn.Close();
            }
        }         
    }
后面还有 5 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。