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 )

12422 put(a) pogledan, 3 odgovor(a) 8.11.2014. 20:05:09Kreirao(la) Samtg
Samtg

Samtg

8.11.2014. 20:05:10
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.
Ovaj sadržaj još nije ocijenjen. 
440 Reputacija 38 Ukupno objava
imarusic

imarusic

10.11.2014. 8:20:15
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.
Ovaj sadržaj još nije ocijenjen. 
3016 Reputacija 428 Ukupno objava
khorvat

khorvat

10.11.2014. 8:47:43
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
Ovaj sadržaj još nije ocijenjen. 
15993 Reputacija 2214 Ukupno objava