forgotpassword.aspx.cs

来自「A Portal for uploading images, videos an」· CS 代码 · 共 41 行

CS
41
字号
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.SqlClient;


public partial class forgotpassword : System.Web.UI.Page
{
    SqlConnection sqlcon = new SqlConnection();
    SqlCommand sqlcmd = new SqlCommand();
    String connectionString = "Data Source=JP11;Initial Catalog=starsparkz;Integrated Security=True";
    Int32 searchid = 0;   
    protected void Button2_Click(object sender, EventArgs e)
    {
        SqlConnection sqlcon = new SqlConnection(connectionString);
        sqlcon.Open();
        SqlCommand sqlcmd = new SqlCommand("SELECT * FROM mylogintable where useremail='" + foremailid.Text + "'", sqlcon);
        SqlDataReader sqldr = sqlcmd.ExecuteReader();
        while (sqldr.Read())
        {
            searchid = Convert.ToInt32(sqldr["userid"]);
            if (searchid > 0)
            {
                Response.Redirect("forgotconfirmation.aspx");
            }
            else
            {
                Response.Redirect("Invalidemail.aspx");
            }
        }
        sqlcon.Close();
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?