yeah i m in domain
this app is for domain
UserPrincipal uc = UserPrincipal.FindByIdentity(c, "sohail");
after this step it is directly coming out and rest step are not executing
DateTime? LoggedInTime = uc.LastLogon;
//Current LoggedIn User
uc = UserPrincipal.FindByIdentity(c, userName);
DateTime? CurrentUserLoggedInTime = uc.LastLogon;
label3.Text = CurrentUserLoggedInTime.Value.ToString();