In SharePoint 2010
Use the client object model ( http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.web.currentuser.aspx ).
Sort of:
public void DoStuff() { ClientContext clientContext = ClientContext.Current; clientContext.Load(clientContext.Web, s => s.CurrentUser); clientContext.ExecuteQueryAsync((sender, args) => { var currentUser = clientContext.Web.CurrentUser; }, null); }
In SharePoint 2007
Unfortunately, the client object model does not exist on SP2007. I have done this before:
I assume that there is a WebService that you can use directly in Silverlight, but I do not know one on top of my head.
source share