string userName = Environment.UserName; 转载于:https://www.cnblogs.com/sukiwqy/archive/2010/01/27/1657286.html