📄 zhaohuimima.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;
using System.Web.Mail;
namespace free.bbs
{
/// <summary>
/// Summary description for zhaohuimima.
/// </summary>
public partial class zhaohuimima : System.Web.UI.Page
{
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 Submit1_ServerClick(object sender, System.EventArgs e)
{
myconn=new SqlConnection(Session["str_connection"].ToString());
myconn.Open();
SqlDataReader mydr;
string sqlstr="select * from huiyuan where yonghuming='"+name.Text+"'";
mycomm=new SqlCommand(sqlstr,myconn);
mydr=mycomm.ExecuteReader();
if (mydr.Read())
{
//Label1.Text="该用户已经存在,请重新输入!";
MailMessage mail=new MailMessage();
mail.To=email.Text;
mail.From="huaruan2004@126.com";
mail.Subject="海纳会员取回注册密码";
mail.Body="欢迎您成为海纳的一分子,请您记住您的资料:用户名:"+mydr["yonghuming"]+",密码:"+mydr["mima"]+".希望您能多提宝贵的意见!";
SmtpMail.Send(mail);
myconn.Close();
mydr.Close();
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -