In case you have ever wondered or needed to know, here is how you get the ID of the current user using .NET (C# in this case):
var whoAmIResponse = (WhoAmIResponse)OrganizationService.Execute(new WhoAmIRequest()); var currentUser = new EntityReference(SystemUser.EntityLogicalName, whoAmIResponse.UserId);