There is more than one way to get the current username using C# or VB.NET i will show you one using Environment Variable and one using the WindowsIdentity.
If you are in a Network the output of both methods is different.
using the Environment variable
string currUsername = Environment.UserName;
Dim currUsername As String = Environment.UserName
using the WindowsIdentity
string currUsername = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
Dim currUsername As String = System.Security.Principal.WindowsIdentity.GetCurrent().Name
using the Environment Variable: Username
using the WindowsIdentity: Domainname\Username
if you want to use the Environment variables and want to get the Domainname also, take a look at Environment.UserDomainName Property