如何获取登录网站的用户的确切ID?
我正在使用Visual Studio 2010创建的登录和注册控件,在数据库中唯一标识符在此28e8957e-00b8-4e75-bec9-2b90e640962d
中,例如,如何返回要在SQL命令中使用的确切标识符,例如?
答案 0 :(得分:0)
使用
using System.Web.Security;
Membership.GetUser(HttpContext.Current.User.Identity.Name).ProviderUserKey;