Okay so i have a brows开发者_如何学JAVAer in my form. The browser automatically opens up a log in page on form load. After the user has logged in, the website will say hello and (their user name) For example, after logging in the site will say Hello, Hex. Now in my program i need to extract the name and put it into a label on my form. Is there any way i can do this?
I think you are looking for the User.Identity.Name property. (HttpContext.Current)
Try to use Label1.Text = Me.User.Identity.Name
or as pointed out by Jeff
Label1.Text = HttpContext.Current.User.Identity.Name
精彩评论