storm_voltage
New Member
The following code will check for the user when the user select a Domain account by selecting a value from the \[code\]txtboxDomain.Text\[/code\]\[code\]using (PrincipalContext pc = new PrincipalContext(ContextType.Domain, txtboxDomain.Text)){ // validate the credentials bool isValid = pc.ValidateCredentials(txtboxUsername.Text, txtboxPassword.Text); if (isValid == true) { lblLogin.Text = "Valid User Name and/or Password"; Session["Person"] = txtboxUsername.Text; Session.Timeout = 1; Response.Redirect("default.htm"); } else { lblLogin.Text = "Invalid User Name and/or Password"; }}\[/code\]So, how do I code so that if the user only want to use the local system account? (Suppose that the local system name is \[code\]WIN2008R2_LOCAL\[/code\]?Do I write the code as \[code\]using (PrincipalContext pc = new PrincipalContext(ContextType.Domain, "WIN2008R2_LOCAL"))\[/code\](I tried the above code but it does not work. So wondering how should I code then.)