In a SharePoint context, like a Web Part, Application Page, or an
ASP.NET application embedded within a WSS context, you can use the
following C#:
SPUser currUser =
Microsoft.SharePoint.SPContext.Current.Web.CurrentUser;
string currLogin = currUser.LoginName;
Of course, if you don't have a SharePoint context, ASP.NET also knows
who is logged:
User currUser = System.Web.HttpContext.Current.User.Identity;
string currLogin = currUser.Name;
In a Content Editor Web Part just use:
<h1>_LogonUser_</h1>