c# - How to find the logged in user in Sharepoint? -
i have developed "web part" has deployed on sharepoint server. need username of user, has logged in sharepoint server within web part.
how username?
following worked me:
spweb thesite = spcontrol.getcontextweb(context); spuser theuser = thesite.currentuser; string strusername = theuser.loginname;
and check this out.