How to know under which account my ASP.NET application is running?

SheoNarayan
Posted by SheoNarayan under ASP.NET category on | Points: 40 | Views : 3715
To know the user name under which your ASP.NET application is running, execute below code snippet in the Page_Load and it should print the name in the browser

using System.Security.Principal;

               WindowsIdentity id = WindowsIdentity.GetCurrent();
Response.Write("Name: " + id.Name + "<br>");


Thanks

Comments or Responses

Login to post response