Lightswitch中的WindowsIdentity [英] WindowsIdentity in lightswitch

查看:78
本文介绍了Lightswitch中的WindowsIdentity的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在lightswitch中使用用户名?

is there a way to use username in lightswitch??


我知道我是否写:


this.application.user.Name





it shows it but only if i enable windows authnetication.

is there a way i can do that but without have to use windows authentication??

我也尝试过:

System.Security.Principal.WindowsIdentity.GetCurrent.Name

System.Security.Principal.WindowsIdentity.GetCurrent.Name

在Windows窗体应用中,它可以正常工作,但在lightswitch中却不能

in a windows form app it works fine but in lightswitch it doesnt

,还尝试了以下方法:

System.Environment.UserName

System.Environment.UserName

没有任何作用

请帮助我

推荐答案

奥斯卡奖,

身份是通过Windows(登录的用户)或我打开应用程序时提供给用户的表单的方式(=表单身份验证)提供的.

Identity is provided either by windows (the user that logged-on) or my means of a form presented to the user when opening the app (= forms authentication).

LightSwitch支持这两种方法.

LightSwitch supports both methods.

当您激活表单身份验证时,auth This.Application.User.Name将指向"TestUser".但是,在部署应用程序时,您会注意到它指向当前用户.

When you activate forms auth This.Application.User.Name will point to "TestUser". Nonetheless, when you deploy your app, you will notice that it points to the current user.


这篇关于Lightswitch中的WindowsIdentity的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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