سؤال

I see all kinds of code to get current SharePoint 2010 logged in user. (I guess current context user from the browser client).

What is the best code? (not currently logged into machine user)

هل كانت مفيدة؟

المحلول

Use SPContext.Current.Web.CurrentUser will give you the current user SPUser object (browser). To get the current user loginname use SPContext.Current.Web.CurrentUser.LoginName .

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى sharepoint.stackexchange
scroll top