Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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 23-Apr-13 23:41pm
ninazi266
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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!
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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*/
             }
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

I cant do it yet i read many opensource code & I try all of them but none of them was usefull
:(
  Permalink  
Comments
Ankur\m/ at 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)

  Print Answers RSS
0 OriginalGriff 400
1 Jochen Arndt 190
2 Richard MacCutchan 135
3 DamithSL 95
4 Garth J Lancaster 90
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,032
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,220


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 25 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100