本文介绍了捕获窗口在asp.net mvc的请求用户名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个内联网应用asp.net的MVC网站。反正是有其站点一个完整的登录系统wihtout从用户获取Windows NT的登录。我不希望应用权限,但我想这样做在服务器上的一些日志记录来跟踪请求等。

i have an intranet app asp.net mvc site. is there anyway to capture the windows nt login from the user wihtout having a full login system in the site. i dont want permissioning but i would like to do some logging on the server to track requests, etc . .

推荐答案

您可以使用 HttpContext.Current.User.Identity.Name 如果你设置站点使用。许多浏览器会把透明的用户名。

You can use HttpContext.Current.User.Identity.Name if you set up the site to use Windows Authentication. Many browsers will pass the username on transparently.

这篇关于捕获窗口在asp.net mvc的请求用户名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 17:34