如何在asp.net中用c#在获得当前系统登陆的帐户的Identity


Posted on May 3, 2007


Environment.UserName   获取启动当前线程的用户名;  
Environment.UserDomainName   获取当前用户所在的域.

// Sample for the Environment.UserName property
using System;

class Sample
{
    public static void Main()
    {
        Console.WriteLine();
        Console.WriteLine("UserName: {0}", Environment.UserName);
    }
}

标签:N/A

 

在线学习答案查询入口
微信扫一扫
微信扫码联系