从asp.net成员身份验证的用户ID? [英] userid from asp.net Membership Authentication?

查看:101
本文介绍了从asp.net成员身份验证的用户ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是用于用户认证的​​asp.net登录控制。我也有我的应用程序和现在(发展的目的),许多表的用户ID,用户ID是,我做了一个int。
不过,我想开始使用我的表框架的用户ID。在哪里以及如何访问实际的用户ID,什么是它的数据类型?

I'm using the asp.net login control for user authentication. I also have the userID in many tables in my application and for now (development purposes), the userID is an int that I'm making up. However, I'd like to start using the userID of the framework in my tables. Where and how do I access the actual userID and what's its datatype?

推荐答案

使用的 ProviderUserKey 成员的MembershipUser 对象,像这样的:

Use the ProviderUserKey member of the MembershipUser object, like this:

MembershipUser user = Membership.GetUser();
string id = user.ProviderUserKey.ToString();

这篇关于从asp.net成员身份验证的用户ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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