获取当前用户ID客户端MVC.NET [英] Get current user ID client MVC.NET

查看:97
本文介绍了获取当前用户ID客户端MVC.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好.net那边的大师,,,

我需要帮助,,,

我使用MV创建应用程序网站。 Studio 2015没有登录表单。



然后我把我的应用程序放到服务器A.
当我用计算机客户端打开时
,我总是得到服务器的当前用户。



i想要获得当前的用户客户端。

请帮帮我..



我尝试过:

<这是我的代码:

hi master of .net over there,,,
i need help,,,
i create the application web using MV. Studio 2015 without "login form".

and then i put my application to the server A.
when i open using the computer client, i always get the current user of server.

i want to get the current user client.
please help me..

What I have tried:

this is my code :

Dim user_id = System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString()





但是总是得到Server的currentUser,我不需要它。但是我需要userClient,而不是userServer。



请帮帮我



but always get the currentUser of Server, i don't need it. but i need userClient, not userServer.

please help me

推荐答案

我希望你在找使用ASP.NET MVC的Intranet站点,Windows身份验证 [ ^ ]



I hope you are looking for Intranet Site Using ASP.NET MVC , Windows Authentication[^]

string userid = HttpContext.User.Identity.Name; // use this to get the client userid


这篇关于获取当前用户ID客户端MVC.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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