SPSecurity.RunWithElevatedPrivileges(delegate()<br /> {<br /> using (SPSite site = new SPSite(SPContext.Current.Site.Url))<br /> {<br /> //ServerContext object current site<br /> ServerContext context = ServerContext.GetContext(site);<br /> //UserProfileManager object to access MOSS user profiles<br /> UserProfileManager profileManager = new UserProfileManager(context, false);<br /> string[] userName;<br /> userName = objUserUtility.GetCurrentUserLoginName().Trim().Split('\\');<br /> <br /> WriteToLog(userName[1].ToString());<br /> <br /> if (profileManager.UserExists(userName[1]))<br /> <br /> {<br /> WriteToLog("Entered Inside");<br /> WriteToLog(userName[1].ToString());<br /> }<br /> else<br /> <br /> {<br /> lblUserExist.Visible = true;<br /> lblUserExist.Text = "You are not configured in the Application";<br /> }<br />
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)