{"id":653,"date":"2019-03-30T20:37:20","date_gmt":"2019-03-30T17:37:20","guid":{"rendered":"http:\/\/www.aydiner.gen.tr\/?p=653"},"modified":"2022-01-30T22:08:03","modified_gmt":"2022-01-30T19:08:03","slug":"asp-net-kullanici-girisi","status":"publish","type":"post","link":"https:\/\/www.aydiner.gen.tr\/index.php\/2019\/03\/30\/asp-net-kullanici-girisi\/","title":{"rendered":"Asp.net Kullan\u0131c\u0131 Giri\u015fi"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-547\" src=\"https:\/\/www.aydiner.gen.tr\/wp-content\/uploads\/2018\/12\/visual-studio-logo-150x150.jpg\" alt=\"\" width=\"150\" height=\"150\" data-id=\"547\" srcset=\"https:\/\/www.aydiner.gen.tr\/wp-content\/uploads\/2018\/12\/visual-studio-logo-150x150.jpg 150w, https:\/\/www.aydiner.gen.tr\/wp-content\/uploads\/2018\/12\/visual-studio-logo-100x100.jpg 100w\" sizes=\"auto, (max-width: 150px) 100vw, 150px\" \/><\/p>\n<p>uye ad\u0131nda veritaban\u0131&nbsp;<\/p>\n<p>bilgi ad\u0131nda tablo (id,eposta,sifre)<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><!--more--><\/p>\n<pre class=\"lang:default decode:true\">\/\/default.aspx\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Configuration;\/\/2  ctrl + .\r\nusing System.Data;\/\/3\r\nusing System.Data.SqlClient;\/\/1\r\nusing System.Linq;\r\nusing System.Web;\r\nusing System.Web.UI;\r\nusing System.Web.UI.WebControls;\r\n\r\n\r\nnamespace uye\r\n{\r\n    public partial class WebForm1 : System.Web.UI.Page\r\n    {\r\n        protected void Page_Load(object sender, EventArgs e)\r\n        {\r\n\r\n        }\r\n\r\n        protected void Button1_Click(object sender, EventArgs e)\r\n        {\r\n            SqlConnection baglanti = new SqlConnection();\r\n           \r\n\r\n            baglanti.ConnectionString = ConfigurationManager.ConnectionStrings[\"baglanti\"].ConnectionString;\/\/sql ba\u011flant\u0131 metni\r\n\r\n            string selectsorgusu = string.Format(\"select * from bilgi where eposta='{0}' and sifre='{1}'\", TextBox1.Text, TextBox2.Text);\r\n\r\n            SqlDataAdapter adaptor = new SqlDataAdapter(selectsorgusu, baglanti);\/\/tablo adapt\u00f6r i\u00e7erisinde saklan\u0131yor..\r\n\r\n            DataTable tablo = new DataTable();\/\/RAM de bir sanal tablo olu\u015fturmak i\u00e7in kullan\u0131l\u0131r...\r\n\r\n            adaptor.Fill(tablo);\/\/adaptorden gelen de\u011fer tabloya aktar\u0131l\u0131r.\r\n\r\n            if (tablo.Rows.Count == 0) \/\/sat\u0131rlar\u0131n\u0131n say\u0131s\u0131 s\u0131f\u0131ra e\u015fitse yani kullan\u0131c\u0131 yoksa\r\n            {\r\n                Response.Write(\"&lt;script&gt;alert('Kullan\u0131c\u0131 Ad\u0131 veya \u015eifre Yanl\u0131\u015f');&lt;\/script&gt;\");\r\n                TextBox1.Text = \"\";\r\n                TextBox2.Text = \"\";\r\n                TextBox1.Focus();\r\n            }\r\n\r\n            else\r\n            {\r\n                Response.Write(\"&lt;script&gt;alert('HO\u015eGELD\u0130N\u0130Z');&lt;\/script&gt;\");\r\n                Session[\"kadi\"] = TextBox1.Text;\r\n                Response.Redirect(\"anasayfa.aspx?kadi=\"+TextBox1.Text);\r\n            }\r\n\r\n\r\n\r\n\r\n\r\n\r\n        }\r\n    }\r\n}<\/pre>\n<pre class=\"lang:default decode:true \">\/\/ anasayfa.aspx\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Web;\r\nusing System.Web.UI;\r\nusing System.Web.UI.WebControls;\r\n\r\nnamespace uye\r\n{\r\n    public partial class anasayfa : System.Web.UI.Page\r\n    {\r\n        protected void Page_Load(object sender, EventArgs e)\r\n        {\r\n            Label1.Text =\"Ho\u015fgeldin \"+ Request.QueryString[\"kadi\"].ToString();\r\n            \r\n        }\r\n\r\n        protected void LinkButton1_Click(object sender, EventArgs e)\r\n        {\r\n            Session[\"kadi\"] = null;\r\n            Response.Redirect(\"WebForm1.aspx\");\r\n        }\r\n    }\r\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>uye ad\u0131nda veritaban\u0131&nbsp; bilgi ad\u0131nda tablo (id,eposta,sifre) &nbsp; &nbsp;<\/p>\n","protected":false},"author":1,"featured_media":547,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,6],"tags":[32,33],"class_list":["post-653","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programlama","category-web","tag-asp-net","tag-kullanici-girisi"],"_links":{"self":[{"href":"https:\/\/www.aydiner.gen.tr\/index.php\/wp-json\/wp\/v2\/posts\/653","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aydiner.gen.tr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aydiner.gen.tr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aydiner.gen.tr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aydiner.gen.tr\/index.php\/wp-json\/wp\/v2\/comments?post=653"}],"version-history":[{"count":0,"href":"https:\/\/www.aydiner.gen.tr\/index.php\/wp-json\/wp\/v2\/posts\/653\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.aydiner.gen.tr\/index.php\/wp-json\/wp\/v2\/media\/547"}],"wp:attachment":[{"href":"https:\/\/www.aydiner.gen.tr\/index.php\/wp-json\/wp\/v2\/media?parent=653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aydiner.gen.tr\/index.php\/wp-json\/wp\/v2\/categories?post=653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aydiner.gen.tr\/index.php\/wp-json\/wp\/v2\/tags?post=653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}