[Mono-list] how to get user name in the linux system

Sandy Dunlop sandy at sorn.net
Tue May 8 13:02:55 EDT 2007


An example of using WindowsIdentity to get the username:

using System.Security.Principal;
...
WindowsIdentity id = WindowsIdentity.GetCurrent();
Console.WriteLine(id.Name);


I've tested that this works properly on Mono.


--  
sandy

On 8 May 2007, at 17:14, Mirek Binas wrote:

> hello
>
> i am trying to find a way, how to get the name/login of user, that  
> run/started application. still not very successfuly. have you any  
> idea, how to do it?
>
> thanks for help
>
> mirek
> -- 
> e-mail: mirek at host.sk
> jabber: mirek at jabbim.sk
> homepage: http://www.intrak.sk/~binas
>
> english:
> Please avoid sending me Word or PowerPoint attachments.
> See http://www.fsf.org/philosophy/no-word-attachments.html
>
> slovak:
> prosim, neposielajte mi prilohy vo formatoch .doc a .ppt (power point)
> precitajte si http://www.fsf.org/philosophy/no-word- 
> attachments.cs.html
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list



More information about the Mono-list mailing list