How to programmatically define an ASP.Net account workflow

My web application is a product that needs to be deployed on various web servers. Is there a way to determine the name of the account that the .Net workflow account uses at runtime?

Using .Net 3.5, C #

Thanks in advance

-Pete

+4
source share
1 answer

Have you tried System.Environment.UserName ?

Edit

You are correct, the custom environment name does not work. Here you can try something else that I tested in IIS 7 / Windows Vista:

System.Security.Principal.WindowsIdentity.GetCurrent().Name

It returns "NT AUTHORITY \ NETWORK SERVICE" for me, since my application pool works as a network service by default.

+5
source

Source: https://habr.com/ru/post/1307313/


All Articles