gpt4 book ai didi

c# - 在 ASP.NET 中获取登录用户的用户 ID

转载 作者:太空宇宙 更新时间:2023-11-03 16:49:53 24 4
gpt4 key购买 nike

如何获取登录到站点的用户的确切 ID?

我正在使用由 Visual Studio 2010 创建的登录和注册控件,在数据库中,唯一标识符位于此 28e8957e-00b8-4e75-bec9-2b90e640962d 例如我如何返回例如,要在 SQL 命令中使用的确切一个?

最佳答案

使用

using System.Web.Security;

Membership.GetUser(HttpContext.Current.User.Identity.Name).ProviderUserKey;

关于c# - 在 ASP.NET 中获取登录用户的用户 ID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4354744/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com