开发者

Check under which account resources are accessed

开发者 https://www.devze.com 2022-12-17 21:28 出处:网络
Is there a way how I can check programmatically which user is used when my application accesses resources?

Is there a way how I can check programmatically which user is used when my application accesses resources?

I have a production system which only our admin can access. Sometimes it is not clear what part of the system is wrong: Lets say when logging is not working. It is always possible that the web.config is wrong, but sometimes the directory is not accessible. It would make my life easier if I could be sure, that开发者_开发百科 the user is used, that I expected.

I am not talking about User.Identity.


You can return the underlying system account that you're running as:

Response.Write(Environment.UserName);

Unless you're using impersonation though, this should always be the ASP.Net process user.

0

精彩评论

暂无评论...
验证码 换一张
取 消