X
تبلیغات
کالج کارآفرینی تیوان
این وبلاگ تقریبا تخصصی است و در گوشه کنار آن جک و پیام زیبا گذاشته می شود
یکشنبه 18 شهریور‌ماه سال 1386
پای قولی که دادم موندم

 این کد فرم ورود با حق عضویت با کدasp.net

<%@ page language="vb" debug="true" %>

<%@ Import Namespace="System.Data" %>

<%@ Import Namespace="System.Data.OleDb" %>

<%@ Import Namespace="System.DBNull" %>

<script runat="server">

sub bt_click1 ( s As Object, e As EventArgs )

    Dim con As OleDbConnection

     Dim strSelect1 As String

     Dim dtr As OleDbDataReader

     Dim cmdSelect As OleDbCommand

 

     con = New OleDbConnection( "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=c:admin.mdb" )

     strSelect1 = "Select * From admin Where uid=?  and pass=?"

     cmdSelect = New OleDbCommand( strSelect1, con )

     cmdSelect.Parameters.Add( "@uid", uid.Text )

     cmdSelect.Parameters.Add( "@pass", pass.Text )

     con.Open()

     if cmdSelect.Executescalar()="" then

     response.write("<font face='b nazanin'>")

    response.write("<b>")

     response.write("شما مجاز نیستید")

     else

      response.redirect("admin_index.aspx")

end if

      con.Close()

     End Sub

</script>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML>

     <HEAD>

           <title>WebForm1</title>

         <meta name="GENERATOR" content="Microsoft FrontPage 5.0">

           <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">

           <meta name="vs_defaultClientScript" content="JavaScript">

           <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">

     </HEAD>

     <body MS_POSITIONING="GridLayout">

           <form id="Form1" method="post" runat="server">

                <TABLE id="Table1" style="Z-INDEX: 101; LEFT: 358; WIDTH: 272px; POSITION: absolute; TOP: 155; BORDER-COLLAPSE: collapse; HEIGHT: 96px"

                     cellSpacing="0" cellPadding="0" width="272" border="3" height="96" bgcolor="#ffcc99"

                     bordercolor="#FF9933">

                     <TR>

                           <TD width="124">

                                <p align="center"><STRONG>User name</STRONG></p>

                           </TD>

                           <TD width="135"><STRONG>

                                     <asp:TextBox id="uid" runat="server">

                    </asp:TextBox></STRONG></TD>

                     </TR>

                     <TR>

                           <TD width="124">

                                <p align="center"><STRONG>Password</STRONG></p>

                           </TD>

                           <TD width="135"><STRONG>

                                     <asp:TextBox id="pass" textmode="password" runat="server">

                    </asp:TextBox></STRONG></TD>

                     </TR>

                </TABLE>

                <TABLE id="Table2" style="Z-INDEX: 102; LEFT: 437; WIDTH: 120px; POSITION: absolute; TOP: 266; HEIGHT: 32px; border-collapse:collapse"

                     cellSpacing="0" cellPadding="0" width="120" border="0" bordercolor="#111111" height="32">

                     <TR>

                           <TD>

                                <asp:Button id="Button1" onclick="bt_click1" runat="server" Text="click here" Width="136px">

                        </asp:Button></TD>

                     </TR>

                </TABLE>

           </form>

     </body>

</HTML>