ASP.NET Getting Current User Name

后端 未结 8 581
猫巷女王i
猫巷女王i 2021-01-12 10:57

I am trying to build an application on our company\'s intranet using ASP.NET and VB.NET.

Neither of these functions return anything once my application is published

相关标签:
8条回答
  • 2021-01-12 11:49

    Would this work for what you are trying to accomplish? Environment.GetEnvironmentVariable("USERNAME").ToString();

    0 讨论(0)
  • 2021-01-12 11:56

    And yet another way to get the logged-on user name:

    Request.ServerVariables["LOGON_USER"]
    
    0 讨论(0)
提交回复
热议问题