MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

Return User Name  (Mono Support )

Viewed 11262 time(s), 3 post(s) 11/8/2014 8:05:09 PMby Samtg
Samtg

Samtg

11/8/2014 8:05:10 PM
Hi,
     I was wondering, what is a good method to return the current username in the MonoX architecture?  I think I know of some ways to do it, but unsure if it will work.

Thanks.
This content has not been rated yet. 
440 Reputation 38 Total posts
imarusic

imarusic

11/10/2014 8:20:15 AM
Hi,

are you referring to the current logged user? If that's the case you can use code snippet below:

MonoSoftware.MonoX.Utilities.SecurityUtility.GetUserName()
Regards.
This content has not been rated yet. 
3016 Reputation 428 Total posts
khorvat

khorvat

11/10/2014 8:47:43 AM
Hi,

you can get user details by using "SecurityUtility.GetUser()" it will return the MembershipUser which contains username property. This approach is optimized and secure.

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts