Recently, I had to create a asp.net MVC portal for organizing test messages. Since site is personalized for User, we were required to fetch and disply username, when they login. This being intranet site, user is authenticated using Windows Authentication. Windows user names are most of the time are mix of literal, not conveying users First and Last name. I used following code to get User First and Last name, using DirectorySearcher class to query Active Directory. Since user name in HttpContext is in format DomainName\\UserName, I had to extract user name alone and use it filter. using System.DirectoryServices; ... ... DirectorySearcher ds = new DirectorySearcher(); var indexOfBS = User.Identity.Name.IndexOf( "\\" ); ds.Filter = String.Format( "((SAMAccountName={0}))" , User.Identity.Name.Substring(indexOfBS + 1, User.Identity.Name.Length - indexOfBS - 1)); ds.PropertiesToLoad.Add( "givenName" ); ds.PropertiesToLoad.Add( "sn" ); var direc
Though Nestor was thirteen years younger than Kane and perpetually flirting with poverty, they developed an intense addicts' friendship. Williams may see that Kane was wielding none of the the} array of cheating gadgets that casinos had confiscated from grifters over time. He wasn't jamming a lightweight wand in the machine's hopper or zapping the Game King with an electromagnetic pulse. But he was 토토사이트 profitable far an excessive quantity of}, too quick, to be counting on luck alone. And outcome of|as a end result of} learning all the methods on the book could be tiresome if not impossible, let’s a glance at|have a glance at} the way to|tips on how to} beat video poker Jacks or Better.
ReplyDelete