📄 denglu.aspx.cs
字号:
//===========================================================================
// 此文件是作为 ASP.NET 2.0 Web 项目转换的一部分修改的。
// 类名已更改,且类已修改为从文件“App_Code\Migrated\Stub_denglu_aspx_cs.cs”的抽象基类
// 继承。
// 在运行时,此项允许您的 Web 应用程序中的其他类使用该抽象基类绑定和访问
// 代码隐藏页。
// 关联的内容页“denglu.aspx”也已修改,以引用新的类名。
// 有关此代码模式的更多信息,请参考 http://go.microsoft.com/fwlink/?LinkId=46995
//===========================================================================
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 denglu.
/// </summary>
public partial class Migrated_denglu : denglu
{
protected System.Data.SqlClient.SqlConnection myconn;
protected System.Data.SqlClient.SqlCommand mycomm;
protected void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
#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 b1_ServerClick(object sender, System.EventArgs e)
{
string sql="select* from huiyuan where yonghuming=@name and mima=@mima";
myconn=new SqlConnection(Session["str_connection"].ToString());
mycomm= new SqlCommand(sql,myconn);
mycomm.Parameters.Add(new SqlParameter("@name", SqlDbType.Char, 20));
mycomm.Parameters["@name"].Value =Text1.Value.Trim();
mycomm.Parameters.Add(new SqlParameter("@mima", SqlDbType.Char, 20));
mycomm.Parameters["@mima"].Value =password.Value.Trim();
myconn.Open();
SqlDataReader dr;
dr=mycomm.ExecuteReader();
if(dr.Read())
{
Response.Cookies["free_huiyuan"].Value =Text1.Value.Trim();
// string name="name="+System.Web.HttpUtility.UrlEncode(Text1.Value.ToString(),System.Text.Encoding.UTF8);
dr.Close();
myconn.Close();
myconn.Open();
mycomm=new SqlCommand("update huiyuan set lastlogin='"+DateTime.Now+"'where yonghuming='"+Text1.Value.Trim()+"'",myconn);
mycomm.ExecuteNonQuery();
Response.Redirect("default.aspx");
}
else
{
dr.Close();
Response.Redirect("error.aspx");
}
myconn.Close();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -