Click here to Skip to main content
15,903,362 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to read data from COM port (want to get remote to work) Pin
gnadeem30-Dec-06 13:29
gnadeem30-Dec-06 13:29 
GeneralRe: How to read data from COM port (want to get remote to work) Pin
daniilzol30-Dec-06 14:54
daniilzol30-Dec-06 14:54 
GeneralRe: How to read data from COM port (want to get remote to work) [modified] Pin
Luc Pattyn30-Dec-06 16:11
sitebuilderLuc Pattyn30-Dec-06 16:11 
GeneralRe: How to read data from COM port (want to get remote to work) Pin
daniilzol31-Dec-06 8:13
daniilzol31-Dec-06 8:13 
QuestionSocket IO interaction with UI Message pump Question? Pin
Member 288953130-Dec-06 10:43
Member 288953130-Dec-06 10:43 
AnswerRe: Socket IO interaction with UI Message pump Question? Pin
Phillip M. Hoff30-Dec-06 17:00
Phillip M. Hoff30-Dec-06 17:00 
Questionproblem for set RememberMe CheckBox in ASP.net Login Control. Pin
hdv21230-Dec-06 10:04
hdv21230-Dec-06 10:04 
AnswerRe: problem for set RememberMe CheckBox in ASP.net Login Control. Pin
Brad Bruce30-Dec-06 10:59
Brad Bruce30-Dec-06 10:59 
Here's what I use.

A few things to note:
1. I started with http://www.codeproject.com/useritems/Remember_me_next_time.asp[^]
2. I didn't want the password stored, so that is commented out
2b. Since the password isn't available, the automatic login is commented out
3. You should probably change the name of the cookie

Enjoy
Brad


using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Default2 : System.Web.UI.Page
{
	// from http://www.codeproject.com/useritems/Remember_me_next_time.asp
    protected void Page_Load(object sender, EventArgs e)
    {
		if (!IsPostBack)
		{
			if (Request.Cookies["LoginCookie"] != null)
			{
				HttpCookie cookie = Request.Cookies.Get("LoginCookie");
				this.Login1.UserName = cookie.Values["ID"].ToString();
//				string password = cookie.Values["Pass"].ToString();
//				if (Membership.ValidateUser(emailID, password))
//				{
//					FormsAuthentication.RedirectFromLoginPage(emailID, true);
//				}
			}
		}
    }
	protected void Login1_LoggedIn(object sender, EventArgs e)
	{
		CheckBox rm = (CheckBox)Login1.FindControl("RememberMe");

		if (rm.Checked)
		{
			HttpCookie myCookie = new HttpCookie("LoginCookie");
			Response.Cookies.Remove("LoginCookie");
			Response.Cookies.Add(myCookie);
			myCookie.Values.Add("ID", this.Login1.UserName.ToString());
//			myCookie.Values.Add("Pass", this.Login1.Password.ToString());
			DateTime dtExpiry = DateTime.Now.AddDays(15); //you can add years and months too here
			Response.Cookies["LoginCookie"].Expires = dtExpiry;
		}
	}
}

QuestionGUI for remote reboots using Shutdown command Pin
namedalias530-Dec-06 8:09
namedalias530-Dec-06 8:09 
AnswerRe: GUI for remote reboots using Shutdown command Pin
Luc Pattyn30-Dec-06 8:54
sitebuilderLuc Pattyn30-Dec-06 8:54 
GeneralRe: GUI for remote reboots using Shutdown command Pin
namedalias530-Dec-06 9:02
namedalias530-Dec-06 9:02 
GeneralRe: GUI for remote reboots using Shutdown command Pin
Luc Pattyn30-Dec-06 9:25
sitebuilderLuc Pattyn30-Dec-06 9:25 
GeneralRe: GUI for remote reboots using Shutdown command Pin
namedalias530-Dec-06 9:29
namedalias530-Dec-06 9:29 
QuestionFolder Protection.. Pin
kkadir30-Dec-06 8:01
kkadir30-Dec-06 8:01 
AnswerRe: Folder Protection.. Pin
Luc Pattyn30-Dec-06 8:56
sitebuilderLuc Pattyn30-Dec-06 8:56 
AnswerRe: Folder Protection.. Pin
Ami Bar30-Dec-06 10:28
Ami Bar30-Dec-06 10:28 
GeneralRe: Folder Protection.. Pin
kkadir30-Dec-06 11:39
kkadir30-Dec-06 11:39 
GeneralRe: Folder Protection.. Pin
Dave Kreskowiak30-Dec-06 17:08
mveDave Kreskowiak30-Dec-06 17:08 
AnswerKind of Pin
Ennis Ray Lynch, Jr.30-Dec-06 17:38
Ennis Ray Lynch, Jr.30-Dec-06 17:38 
QuestionOpen "Windows Image Fax Viewer" Pin
greekius30-Dec-06 7:33
greekius30-Dec-06 7:33 
AnswerRe: Open "Windows Image Fax Viewer" Pin
Luc Pattyn30-Dec-06 9:21
sitebuilderLuc Pattyn30-Dec-06 9:21 
AnswerRe: Open "Windows Image Fax Viewer" Pin
Luc Pattyn30-Dec-06 9:33
sitebuilderLuc Pattyn30-Dec-06 9:33 
AnswerRe: Open "Windows Image Fax Viewer" Pin
Luc Pattyn30-Dec-06 9:35
sitebuilderLuc Pattyn30-Dec-06 9:35 
QuestionDisplay a Line Graph using Tabbed Panes(Newbie) Pin
NGSjamesc30-Dec-06 5:19
NGSjamesc30-Dec-06 5:19 
AnswerRe: Display a Line Graph using Tabbed Panes(Newbie) Pin
Luc Pattyn30-Dec-06 5:24
sitebuilderLuc Pattyn30-Dec-06 5:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.