SPContext.Current.Web.CurrentUser returns misleading value

后端 未结 5 1724
没有蜡笔的小新
没有蜡笔的小新 2021-01-03 02:02

I\'m trying to find out current user name for my sharepoint application. There are more that one way how to do this. However the sharepoint way returns misleading value.

5条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-03 02:32

    Are you browsing as the admin account that you used to install the system? SharePoint will "helpfully" rename that SHAREPOINT\System. Use a different account and all of the methods will return the same value.

提交回复
热议问题