session in asp.net & c#.net
-
Hi all, i got problem on session tracking using asp.net with c#.net.I need use session when user login into my website. thank you.
%#&kmpYrlHSGYG5@#($_+!@!(*JASnjshdk,cm_0ashjhdbn@#$!48mkhfbchsh))^%#W%&@YW7wsdfjw789';'][]\`~JKJQ4$!@#~)-HSKS^&*1)JK12@#@$~!1`DFGkqp][]\]?Zas;EWRG%!@~)(^&BVAG
-
Hi all, i got problem on session tracking using asp.net with c#.net.I need use session when user login into my website. thank you.
%#&kmpYrlHSGYG5@#($_+!@!(*JASnjshdk,cm_0ashjhdbn@#$!48mkhfbchsh))^%#W%&@YW7wsdfjw789';'][]\`~JKJQ4$!@#~)-HSKS^&*1)JK12@#@$~!1`DFGkqp][]\]?Zas;EWRG%!@~)(^&BVAG
Could you tell us what your problem is?
.: I love it when a plan comes together :. http://www.zonderpunt.nl
-
Hi all, i got problem on session tracking using asp.net with c#.net.I need use session when user login into my website. thank you.
%#&kmpYrlHSGYG5@#($_+!@!(*JASnjshdk,cm_0ashjhdbn@#$!48mkhfbchsh))^%#W%&@YW7wsdfjw789';'][]\`~JKJQ4$!@#~)-HSKS^&*1)JK12@#@$~!1`DFGkqp][]\]?Zas;EWRG%!@~)(^&BVAG
What is the problem
-
Could you tell us what your problem is?
.: I love it when a plan comes together :. http://www.zonderpunt.nl
here is my source code whn login button clicked.. can you check for me.. private void Button1_Click(object sender, System.EventArgs e) { switch (UserLogin(usertxtname.Text, usertxtpass.Text)) { case 1: Session.Abandon(); Login(); break; case 2: Label4.Text = "Incorrect Password"; break; case 3: Label4.Text = "Incorrect Username"; break; } } public void Login() { FormsAuthenticationTicket objTicket = null; HttpCookie objCookie = null; string strReturnURL = null; objTicket = new FormsAuthenticationTicket(1, usertxtname.Text, System.DateTime.Now, DateTime.Now.AddMinutes(60), false, Session.SessionID); objCookie = new HttpCookie(".ASPXAUTH"); objCookie.Value = FormsAuthentication.Encrypt(objTicket); Response.Cookies.Add(objCookie); strReturnURL = Request.QueryString["ULogin.aspx"]; if (strReturnURL != null) Response.Redirect("ULogin.aspx"); else Response.Redirect("registration.aspx", false); } public int UserLogin(string strUsername, string strPassword) { int iReturnValue = 0; string sql; OdbcConnection myconn; OdbcDataReader MyReader = null; sql="Select count(*) as expr1 From login Where (pword='"+usertxtpass.Text+"')And(uname='"+usertxtname.Text+"')"; myconn= new OdbcConnection ("DSN=myodbc2;SERVER=localhost;DATABASE=misdb;UID=root;PORT=3306"); OdbcCommand cmd = new OdbcCommand(sql, myconn); cmd.Parameters.Add("@username", strUsername); cmd.Parameters.Add("@password", strPassword); cmd.Parameters.Add("@ReturnValue", OdbcType.Int).Direction = ParameterDirection.ReturnValue; myconn.Open(); MyReader=cmd.ExecuteReader(); MyReader.Read(); **iReturnValue = System.Convert.ToInt32(cmd.Parameters["@ReturnValue"].Value.ToString());**myconn.Close(); return iReturnValue; }
%#&kmpYrlHSGYG5@#($_+!@!(*JASnjshdk,cm_0ashjhdbn@#$!48mkhfbchsh))^%#W%&@YW7wsdfjw789';'][]\`~JKJQ4$!@#~)-HSKS^&*1)JK12@#@$~!1`DFGkqp][]\]?Zas;EWRG%!@~)(^&BVAG
-
here is my source code whn login button clicked.. can you check for me.. private void Button1_Click(object sender, System.EventArgs e) { switch (UserLogin(usertxtname.Text, usertxtpass.Text)) { case 1: Session.Abandon(); Login(); break; case 2: Label4.Text = "Incorrect Password"; break; case 3: Label4.Text = "Incorrect Username"; break; } } public void Login() { FormsAuthenticationTicket objTicket = null; HttpCookie objCookie = null; string strReturnURL = null; objTicket = new FormsAuthenticationTicket(1, usertxtname.Text, System.DateTime.Now, DateTime.Now.AddMinutes(60), false, Session.SessionID); objCookie = new HttpCookie(".ASPXAUTH"); objCookie.Value = FormsAuthentication.Encrypt(objTicket); Response.Cookies.Add(objCookie); strReturnURL = Request.QueryString["ULogin.aspx"]; if (strReturnURL != null) Response.Redirect("ULogin.aspx"); else Response.Redirect("registration.aspx", false); } public int UserLogin(string strUsername, string strPassword) { int iReturnValue = 0; string sql; OdbcConnection myconn; OdbcDataReader MyReader = null; sql="Select count(*) as expr1 From login Where (pword='"+usertxtpass.Text+"')And(uname='"+usertxtname.Text+"')"; myconn= new OdbcConnection ("DSN=myodbc2;SERVER=localhost;DATABASE=misdb;UID=root;PORT=3306"); OdbcCommand cmd = new OdbcCommand(sql, myconn); cmd.Parameters.Add("@username", strUsername); cmd.Parameters.Add("@password", strPassword); cmd.Parameters.Add("@ReturnValue", OdbcType.Int).Direction = ParameterDirection.ReturnValue; myconn.Open(); MyReader=cmd.ExecuteReader(); MyReader.Read(); **iReturnValue = System.Convert.ToInt32(cmd.Parameters["@ReturnValue"].Value.ToString());**myconn.Close(); return iReturnValue; }
%#&kmpYrlHSGYG5@#($_+!@!(*JASnjshdk,cm_0ashjhdbn@#$!48mkhfbchsh))^%#W%&@YW7wsdfjw789';'][]\`~JKJQ4$!@#~)-HSKS^&*1)JK12@#@$~!1`DFGkqp][]\]?Zas;EWRG%!@~)(^&BVAG
Eduard asked what your PROBLEM is not for a code dump. X|
Never underestimate the power of human stupidity RAH