<HTML> <HEAD> <link rel="STYLESHEET" type="text/css" href="cssClass.css"> <TITLE>Web Login $>@< vvA3ME (.0=1>;4)</TITLE> </HEAD> <BODY> <script src="coolmenus_frame.js" type="text/javascript"></script> <A NAME="WebLoginForm"></A> <P>&nbsp;</P> <h1 align=center>Web Login $>@< vvA3ME</h1> <P>&nbsp;</P> <i> <UL TYPE=circle> <LI><a href="#LoginForm">M2B@ME D>@<K= 68HMM</a></LI> <LI><a href="#EmployeeClass">Employee :;0AA</a></LI> <LI><a href="#CheckLogin">Login-K3 H0;30E</a></LI> <LI><a href="#BackLoad">CF00E $>@< vvA3ME</a></LI> <LI><a href="#Success"><68;BB09 185;AM= v54</a></LI> </UL> </i><br> 03043v9 B0 2M1 ECC4ACC400@ 7>G8;6 109E400 BCE09= ECC4A=K 1>;><6K3 1v@M= 0H83;0EK= BC;4 1v@B3vv;ME vv 3MAM= 0ACC;BB09 B00@G 109A0= 187 MM. "0 M=MEvv E8GMM;MMA EM@EM= login (=M2B@ME) D>@<K3 TT@89= 2M1 ?@>3@0<<4 E89E893 AC@0;F0E 1>;=>. <a name="LoginForm"> <P>&nbsp;</P> <h2>M2B@ME D>@<K= 68HMM</h2><p> MM@E 68HMM =L A5@25@ 4ME NorthWind T3T34;89= 1007K= Employee EvA=M3BMMA >2>3, =M@893 02G >@CC;A0= T3T34T;BM9 BC;30=, EM@M2 >@CC;A0= T3T34T; 100704 109300 1>; 2M1 ECC40AK3 F00H v@3M;6vv;=M. %0@8= v3v9 1>; 40E8= >@CC;0EK3 EvAME 1>;=>. <P>&nbsp;</P> Login D>@< E89E 0;E0<CC4: <br> -E;MM4 B0 Web Application ?@>65:BK3 Visual Studio-4 vvA3ME EM@M3BM9. <OL> <LI>Visual Studio-3 068;;CC;0=, Create New Project-3 A>=3>=>. </LI> <LI>vv= B0;K= F>=E=>>A Visual Basic Projects A>=3>=, on ASP.NET Web Application-K3 Templete F>=E>>A 84M2E6vv;=M.</LI> <LI>Name B0;10@B LoginSample </LI> <LI>Web Application ?@>65:B E00=0 vvA3ME893 A>=3>=>. (http://localhost/LoginSample)</LI> <LI>Ok B>2G;CC@K3 40@A=00@ H8=M Web Application vvA3ME 1>;=>.</LI> <LI>T@89= 2M1 D>@<K= =M@893 Web Form1.aspx 109A=K3 Login.aspx 1>;3>= TT@G8;=T vv.</LI> <LI>4>> B0 Toolbox->>A EM@M3FMMB :>=B@>;CC4K3 D>@<4 109@;CC;=0 CC. <table border=1 cellspacing="1" cols=3 frame=box rules=all><b> <tr ><th>>=B@>;K= BT@T;</th><th>Property</th><th>#B30</th></tr></b> <tr><td>Label</td><td>Name</td><td>Label1</td></tr> <tr><td></td><td>Text</td><td>First Name</td></tr> <tr><td>TextBox</td><td>Name</td><td>txtFirst</td></tr> <tr><td></td><td>Text</td><td>Andrew</td></tr> <tr><td>Label</td><td>Name</td><td>Label2</td></tr> <tr><td></td><td>Text</td><td>Last Name</td></tr> <tr><td>TextBox</td><td>Name</td><td>txtLast</td></tr> <tr><td></td><td>Text</td><td>Fuller</td></tr> <tr><td>Button</td><td>Name</td><td>btnSubmit</td></tr> <tr><td></td><td>Text</td><td>Login</td></tr> </table> </LI> </OL> <a name="EmployeeClass"> <P>&nbsp;</P> <h2>Employee :;0AA</h2><p> 0@00E :;0AA4 FirstName, LastName 3MAM= 2 property, EmployeeValid 3MAM= method 109@;0=0. Property-=CC4 2M1 D>@<>>A CB30 C=H8= E0430;=0. Method =L 100704 >@CC;A0= =M@, >2>3 109300 MAME893 H0;30=0.<p> Project -> Add Class-K3 <5=N=00A A>=3>=>. M@893 =L Employee.vb 3M6 A>;8=>. (8=M :;0AAK3 =MM6 40@00E :>4K3 18G=M. <br> <Pre syntax> Public Class Employee Private mstrFirst As String Private mstrLast As String Property LastName() As String Get Return mstrLast End Get Set(ByVal Value As String) mstrLast = Value End Set End Property Property FirstName() As String Get Return mstrFirst End Get Set(ByVal Value As String) mstrFirst = Value End Set End Property Public Function EmployeeValid() As Boolean Dim oCmd As OleDb.OleDbCommand Dim oDR As OleDb.OleDbDataReader Dim strSQL As String Dim strConn As String Dim boolFound As Boolean '** %>;1>;BK= BM<4M3B <T@ vvA3ME strConn = "Provider=sqloledb" strConn &= ";Data Source=(local)" strConn &= ";Initial Catalog=Northwind" strConn &= ";User id=sa" strConn &= ";Password=" '** %M@M368E :><<0=4K= B5:AB strSQL = "SELECT EmployeeID FROM Employees " strSQL &= "WHERE LastName = '" & mstrLast & "' " strSQL &= "AND FirstName = '" & mstrFirst & "' " '** Command >1J5:B vvA3ME oCmd = New OleDb.OleDbCommand() With oCmd .CommandText = strSQL .CommandType = Data.CommandType.Text .Connection = _ New OleDb.OleDbConnection(strConn) .Connection.Open() End With '** SQL-K3 068;;CC;0E oDR = oCmd.ExecuteReader( _ CommandBehavior.SequentialAccess) boolFound = oDR.Read '** Data Reader 1>;>= Connection-K3 E00E oDR.Close() oCmd.Connection.Close() '** DC=:FK= 1CF00E CB30 True MA2M; False Return boolFound End Function End Class </pre> EmployeeValid method =L SQL Select <M4M34M; vvA3M=, M=M =L :;0AAK= 2 property-= CB300@ EvA=M3B=89 T3T34;vv4MMA Hvv;B E89=, 18G;M3893 OleDbDataReader >1J5:B @CC 1CF00= 40<6CC;=0. OleDbDataReader >1J5:BK= Read method =L EM@M2 O<0@ =M3 T3T34T; 1CF06 8@AM= 1>; v=M= (true), E>>A>= 1>; EC40; (false) CB30 1CF00=0. BoolFound EC2LA03GK= CB3K3 DC=:FK= 1CF0E CB30 1>;3>= 02G 109=0. <P>&nbsp;</P> %M@M2 B0 Microsoft Access 1007 0H83;0E 3M6 1C9 1>; E>;1>;BK= BM<4M3B <T@893 40@00E 1094;00@ TT@G8;=T vv. (B0 70<K3 =L A>;8E>> <0@B200 :-))<br> <Pre syntax> "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Northwind\Northwind.mdb" </Pre> <a name="CheckLogin"> <P>&nbsp;</P> <h2>Login-K3 H0;30E</h2><p> 4>> B0 Employee :;0AAB09 10 vv=893MM Login B>2G;CC@K= Click v7M34;89= ?@>F54C@B 0H83;0=0. <OL> <LI>Login.aspx 2M1 D>@<K= design mode-3 A>=3>=> CC.</LI> <LI>Login B>2G;CC@ 4MM@ 402E0@ B>2H8;B E89=M. </LI> <LI>0@00E :>4K3 Click v7M34;89= ?@>F54C@B 18G=M. </LI> </OL> <Pre syntax> Private Sub btnSubmit_Click(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles btnSubmit.Click Dim oEmp As Employee = New Employee() With oEmp .LastName = txtLast.Text .FirstName = txtFirst.Text If .EmployeeValid() Then Session("EmpName") = .FirstName & _ " " & .LastName 'Response.Write("<B>Welcome " & _ .FirstName & "</B>") Else 'Response.Write("<B>Invalid Login Name</B>") End If End With End Sub </Pre> MM@E :>4>=4, H8=MM@ Employee >1J5:B vvA3M6, text box-CC400A CB3CC4K3 LastName 10 FirstName property-=CC404 >=>>=>. 0@00 =L EmployeeValid method-K3 4CC40E 10 EM@M2 v=M= CB30 1CF06 8@2M;  Welcome <M@> 3M6 18G8E 10 EC40; 1>;  Invalid Login Name 3M6 1@0>C75@B 18G8E 1>;=>. <a name="BackLoad"> <P>&nbsp;</P> <h2>CF00E $>@< vvA3ME</h2><p> "0 0@09 8;vv A096@CC;6 =M2B@M;B 0<68;BB09 185;AM= vvAME D>@<, 1C@CC 1>; 40E8= >@>;4>EK3 EvAAM= D>@< vvA3MEMM@ TT@G;TE89= BC;4 40@00E 0;E<CC4K3 E89=M. <OL> <LI>(8=MM@ LoginFailure.htm D09;K3 Project -> Add HTML Page FMA=MMA A>=3>= vvA3M=M <LI>%CC40A0= 4MM@ <M4MM;;MM >@CC;=0. 8HMM =L:  The first name and last name that you typed in, do not exist in the employee database, please re-enter the information 3M6 18G=M vv. (Property F>=E=>>A pagelayout property-3 FlowLayout 1>;3>A>= MAME893 H0;300@09)</LI> <LI>%MAM3 E>>A>= <T@ 02G  re-login 3M6 18GMM4 M=M B5:ABMM 84M2E6vv;=M.</LI> <LI>Insert -> Hyperlink FMA=MMA A>=3>=>.</LI> <LI>URL B0;10@ 4MM@ Login.aspx 3M6 18G=M. </LI> <LI>Login.aspx 2M1 D>@<K3 =MM6 Login button 4MM@ 402E0@ B>2H8;B E896</LI> <LI>0@00E <T@893 Response.Write("<B>Invalid Login Name</B>") >;>>4 Response.Redirect("LoginFailure.htm")-3M6 A>;8=>.</LI> </OL> <a name="Success"> <P>&nbsp;</P> <h2><68;BB09 185;AM= v54</h2><p> 4>> B0 0<68;BB09 E>;1>34A=K3 EM@M3;M3G89= =M@89= E0<B <M4M34ME D>@< E89=M. <OL> <LI>LoginSuccess.aspx D>@<K3 Project|Add HTML Page New-MMA A>=3>=>.</LI> <LI>Web Form 4MM@ 402E0@ B>2H8;B E89=M.</LI> <LI>0@00E :>4K3 18G=M. <Pre syntax> Private Sub Page_Load(ByVal Sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load Response.Write("Welcome to our web site " & _ Session("EmpName").ToString()) End Sub </Pre> <LI>Login.aspx D>@<K3 =MM6</LI> <LI>Login button 4MM@ 402E0@ B>2H8;B E89=M.</LI> <LI>0@00E <T@893 Response.Write("<B>Welcome " & .FirstName & "</B>") 0@8;30=0. Season EC2LA03G84 M=4 CB30 >=>>6, 4MM@E v7M34;89= ?@>F54C@4 EM@M3;M6 109=0. </LI> </OL> <P>&nbsp;</P> <P align="center"><a href="ASPNET.html">ASP.NET</a> | <a href="#WebLoginForm"> 4MMHMM</a> | <a href="WebBoundForm.html">Web Form-4 T3T34T; 1ME;ME</a> <br> <a href="Main.html">=vv@ ECC40A</a></P <P>&nbsp;</P> </BODY> </HTML>