net中没有Windows登录提示的情况下获取Windows登录

net中没有Windows登录提示的情况下获取Windows登录

本文介绍了如何在asp.net中没有Windows登录提示的情况下获取Windows登录用户名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我使用下面提到的代码来获取登录的Windows用户名,

IIdentity WinId = HttpContext.Current.User.Identity;

WindowsIdentity wi =(WindowsIdentity)WinId;

string user_name = wi.Name;



此代码


1.我在IIS中取消选中匿名身份验证。

2.启用Windows身份验证。



但是在运行它时询问Windows登录提示。然后我才会记录Windows用户名。



我需要使用匿名身份验证来获取Windows用户名。 !!!!!!!



请做...

Hi,
I using below mention code to get logged windows username,
IIdentity WinId = HttpContext.Current.User.Identity;
WindowsIdentity wi = (WindowsIdentity)WinId;
string user_name = wi.Name;


for this code,
1.I have unchecked anonymous authentication in IIS.
2.Enabled windows authentication.

But while running it's asking windows login prompt. then only i m getting logged windows username.

I need using anonymous authentication to get windows username. !!!!!!!

Please do needful...

推荐答案


这篇关于如何在asp.net中没有Windows登录提示的情况下获取Windows登录用户名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 12:18