带存储过程的登录页面 [英] login page with store procedure

查看:84
本文介绍了带存储过程的登录页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨所有

i想创建一个登录页面,其中包含2文本框用户名和密码1按钮用于输入

点击按钮后检查2textboxt如果它们存在于数据库中则输入没有显示说明

我想要回复要求的电脑的IP

我想用商店程序来做这件事PLZ帮帮我新我&我迷茫了

hi all
i want creat a login page with 2text box username and password 1button for enter
after clicking in button check the 2textboxt if they exist in database enter if they aren''t show the note
and I want post back the IP of the pc who requst
I want do It with store procedure plz help me Im new & I confused

推荐答案

这是最好的起点 - Google搜索 - 登录asp.net [ ^ ]



登录控制是任何Web应用程序中非常常见的要求。所以这个功能是开箱即用的ASP.NET 2.0

阅读MSDN链接并在项目中实现它。它有你想要的一切。



希望这有帮助!
This is the best place to start - Google Search - login asp.net[^]

Login control is a very common requirement in any web application. So the feature was available out of the box with ASP.NET 2.0
Read through the MSDN links and implement it in your project. It has everything you want.

Hope this helps!


你可以实现这样的东西:



You can implement this something like:

SqlConnection conn = new SqlConnection();
conn.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["leave"].ConnectionString;
            conn.Open();
            string uname = TextBox1.Text;
            string ps = Textbox2.Text;
            SqlCommand cmd = new SqlCommand("Select uname, pswd from emp_details where uname =@uname and pswd =@ps", conn);
            cmd.Parameters.Add(new SqlParameter("@uname", "db username here"));
            cmd.Parameters.Add(new SqlParameter("@ps", "db pasword here"));
            SqlDataReader dr = cmd.ExecuteReader();
            if (dr.Read())

            {
                label1.text=Server.HtmlEncode(Request.UserHostAddress);/*Gives you the ip address as string*/
                /*Perform operations for authinticated user*/
             }


我不能这样做但我读了很多开源代码并且我尝试了所有的他们但没有一个是有用的

:(
I cant do it yet i read many opensource code & I try all of them but none of them was usefull
:(


这篇关于带存储过程的登录页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆