Geeks With Blogs
Shervin Shakibi's Blog blog May 2008 Entries
How to get the current user logged into Sharepoint
the following snippet get the current user lgged into Sharepoint and displays his/her Name, Login name, Email and all the groups he/she belongs to. try {SPWeb web = SPControl.GetContextWeb(Con... sUser = web.CurrentUser; string str = "Name:" + sUser.Name + "<BR>"; "Login Name :" + sUser.LoginName + "<BR>"; "Email:" + sUser.Email + "<BR>"; "Groups:" + sUser.Groups.Count + "<BR>"; foreach (SPGroup grp in sUser.Groups) { " * " + grp.Name + " total Members:" + grp.Users.Count ......

Posted On Monday, May 19, 2008 5:07 AM

Copyright © Shervin Shakibi | Powered by: GeeksWithBlogs.net