且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

带存储过程的登录页面

更新时间:2023-12-03 19:33:52

这是***的起点 - 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
:(