This is simple.
SPSite site = new SPSite(http://server);
SPWeb myweb = site.OpenWeb();
SPUser found = myweb.AllUsers.GetByID(1);
MELICK RAJEE BARANASOORIYA | Enterprise Architect
This is simple.
SPSite site = new SPSite(http://server);
SPWeb myweb = site.OpenWeb();
SPUser found = myweb.AllUsers.GetByID(1);
Comments
Thanks for the post!
Yeh. Though users are readonly they are still users in the site. In Alternatively you can use EnsureUser method by parsing userlogin
This is getting all the users in the site including user in groups but if you have LoginName it is better to use EnsureUser("domain\Loginname")
Yeah you can get the logged on user detail by accessing spcontext.current user