I'm not a C# programmer, but in plain C on Windows, I'd call the GetUserName() API. I find it hard to believe that C# would require horsing around with creating batch files and returning environment variables just to get the user name! It can't really be that difficult, can it?

Anyway, here's a link to the API I'd use from C:
http://msdn2.microsoft.com/en-us/library/ms724432.aspx


Mark Villa wrote:
Imagine that you can not use Microsoft products - or rather you want
to do this as generic as possible. A call to "C" then possibly going
to 'Netapi32.dll' is required.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.