我如何找出我的asp.net应用程序运行的用户? [英] how do i find out what user my asp.net application running as ?

查看:46
本文介绍了我如何找出我的asp.net应用程序运行的用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

早上好,先生,



请回复我。

解决方案

< blockquote>



你可以使用 Page.User.IsInRole 功能。



查看以下链接。

HttpContext.Current.User.IsinRole返回false [ ^ ]

RolePrincipal.IsInRole Method [ ^ ]

ASP.NET成员资格,表单身份验证,页面.User.IsInRole(u ser) [ ^ ]

如何编写一个检查的asp.net(c#)程序管理员或用户当前是否已登录? [ ^ ]

基于用户的重定向角色? [ ^ ]



希望它有所帮助。


问题不明确。对于环境用户,您可以使用

 Environment.UserName 

并检查这是否是您想要的。


good morning sir ,

please replied to me.

解决方案

Hi,

you can make use of Page.User.IsInRole function.

check below links for that.
HttpContext.Current.User.IsinRole returns false[^]
RolePrincipal.IsInRole Method[^]
ASP.NET Membership, Forms Authentication, Page.User.IsInRole("user")[^]
How to write a asp.net (c#) program that checks the Admin or User are currently logged in?[^]
redirect user based on Roles?[^]

Hope it helps.


Question is not clear. For environment user you can use

Environment.UserName

and check if that is what you want.


这篇关于我如何找出我的asp.net应用程序运行的用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆