国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > .NET > 正文

ASP.NET一個最簡單的會員登陸代碼

2024-07-10 13:10:45
字體:
來源:轉載
供稿:網友

商業源碼熱門下載www.html.org.cn

是用來新手入門的,高手們不要見笑呀!
string conn = "server=.;database=login;user id=sa;pwd=123";
        sqlconnection cn = new sqlconnection(conn);
        cn.open();
        string strsql = "select user_name,user_pwd from admin where user_name='" + textbox1.text + "' or user_pwd='" + textbox2.text + "'";
        sqlcommand cmd = new sqlcommand(strsql, cn);
        sqldatareader rd = cmd.executereader();
        if (rd.read())
        {
            if (rd.getvalue(0).tostring() == textbox1.text)
            {
                if (rd.getvalue(1).tostring() == textbox2.text)
                {
                    response.redirect("default.aspx");
                }
                else
                {
                    response.write("<script>alert('密碼錯誤!')</script>");
                }
            }
            else
            {
                response.write("<script>alert('用戶名錯誤!')</script>");
            }
        }
        else
        {
            response.write("<script>alert('用戶不存在!')</script>");
        }
    }

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 南宫市| 正安县| 南通市| 杭州市| 鄂托克旗| 科技| 固安县| 化隆| 兰西县| 绥德县| 泰和县| 昆明市| 洛川县| 宜良县| 治县。| 许昌市| 长汀县| 广元市| 广饶县| 二连浩特市| 噶尔县| 遂昌县| 怀化市| 鹤岗市| 清镇市| 固安县| 瓦房店市| 乐至县| 宝兴县| 广昌县| 偃师市| 淮滨县| 会东县| 绵竹市| 克东县| 惠东县| 西和县| 牡丹江市| 钦州市| 兰州市| 钦州市|