Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted

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!
 
Share this answer
 
v2
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*/
             }
 
Share this answer
 
v2
I cant do it yet i read many opensource code & I try all of them but none of them was usefull
:(
 
Share this answer
 
Comments
Ankur\m/ 26-Apr-13 6:10am    
Reporting 'Not an Answer'. Please use comment feature to discuss with an answerer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900