keithwilson1
asked on
Correct Active Directory code to retrieve a key field
I am using VS2017 and trying to retrieve the username from the active directory of my school district. Below is my syntax.
if (userName != " ")
{
KatyISD.Library.ActiveDire ctory.User user = new KatyISD.Library.ActiveDire ctory.User (userName) ;
Response.Cookies.Add(new HttpCookie("KUId", user.Guid));
Response.Cookies.Add(new HttpCookie("userNetworkID" , user.UserName));
Response.Cookies.Add(new HttpCookie("userName", user.LastName + ", " + user.FirstName));
Response.Redirect("chooseD ataSource. aspx");
}
Is the code correct?
if (userName != " ")
{
KatyISD.Library.ActiveDire
Response.Cookies.Add(new HttpCookie("KUId", user.Guid));
Response.Cookies.Add(new HttpCookie("userNetworkID"
Response.Cookies.Add(new HttpCookie("userName", user.LastName + ", " + user.FirstName));
Response.Redirect("chooseD
}
Is the code correct?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.