Giris.aspx.cs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | protected void girisButon_Click(object sender, EventArgs e) { HttpCookie cerez = new HttpCookie("Kullanici"); if (KullaniciKutu.Text == "xea" & SifreKutu.Text == "123") { cerez["Dogrulama"] = "Onayli"; cerez["Ad"] = KullaniciKutu.Text; cerez["Tarih"] = DateTime.Now.ToString(); Response.Cookies.Add(cerez); Response.Redirect("Panel.aspx"); } else { durum.Text = "* Kullanıcı adı veya şifre yanlış."; } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Giris.aspx.cs" Inherits="WebApplication1._Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <style> body { font-family: 'Segoe UI'; font-size: 11pt; } input[type='text'] { border: solid 1px gray; padding: 4px; width: 100%; } input[type='text']:hover { border-color: blueviolet; } input[type='paswoord'] { border: solid 1px gray; padding: 4px; width: 100%; } input[type='password']:hover { border-color: blueviolet; } input[type='submit'] { border: none; background-color: gray; color: white; height: 30px; width:100px; } input[type='sumbit']:hover { background-color: gray; } #panel { margin-top: 100px; width: 350px; } .girisYazi { font-size: x-large; padding-bottom: 20px; } </style> </head> <body> <form id="form1" runat="server"> <div> <table align="center" id="panel"> <tr> <td class="girisYazi" colspan="2">Giriş Paneli</td> </tr> <tr> <td>Kullanıcı Adı:</td> <td> <asp:TextBox ID="KullaniciKutu" runat="server"></asp:TextBox> </td> </tr> <tr> <td>Şifre:</td> <td> <asp:TextBox ID="SifreKutu" runat="server"></asp:TextBox> </td> </tr> <tr> <td> </td> <td style="text-align: right"> <asp:Button ID="girisButon" runat="server" OnClick="girisButon_Click" Text="Giriş" /> </td> </tr> <tr> <td colspan="2"> <asp:Label ID="durum" runat="server" ForeColor="Red"></asp:Label> </td> </tr> </table> </div> </form> </body> </html> |