简体   繁体   中英

How to keep track of CurrentUser in WPF using ASP.NET Membership

I have the following needs. I am using ASP.NET Membership installed into my database. I need to create a WPF application which needs to have login functionality. I have imported the System.Web.Security namespace so I can validate and create users with Membership static methods. My question is if there is something similar to keep track which user is logged (like HttpContext.Current.User.Identity in ASP.NET)? Whats the way to get the userID (guid) other than searching the database for user by username? Thank you in advance

尝试使用System.Security.Principal.WindowsIdentity.GetCurrent()Environment.UserName属性。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM