Article View: borland.public.jbuilder.java.api
Article #1569Re: win32 API calls
From: Avi Abrami
Date: Thu, 06 Dec 2001 05:38
Date: Thu, 06 Dec 2001 05:38
29 lines
1699 bytes
1699 bytes
TBerry wrote:
> Anyone out there tried to access win32 API? All I want is to get the
> username entered at o/s login. I've add "com.ms.win32" to my classpath
> and included it to JBuilder without a problem. It compiles but at
> runtime I get:
>
> Can't link Win32 API
> java.lang.UnsatisfiedLinkError: .....
>
> which I gather is because what I'm doing is not supported by my JVM.
>
> Anyone know how to resolve this (I'd rather not install Microsoft's
> JVM), or even better, is there a more Java solution to getting the
> logged-in user's name?
>
> Thank you
> Tom Berry
Hi Tom,
Look at the javadoc for class 'java.lang.System',
and then try this...
System.getProperty("user.name")
Should give you what you want.
Good Luck,
Avi.
Technical Details
Message-ID:
<3C0F044B.49AD7499@intersystemsww.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!130.133.1.3!fu-berlin.de!news.uni-paderborn.de!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3C0EB8A0.D3A3FD09@vhb.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,499af87b5b6945ad X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2001-12-05 21:38:45 PST Message-ID: <3C0F044B.49AD7499@intersystemsww.com> Date: Thu, 06 Dec 2001 07:38:19 +0200 From: Avi Abrami <aabrami@intersystemsww.com> Organization: InterSystems Ltd X-Mailer: Mozilla 4.78 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.java.api Subject: Re: win32 API calls References: <3C0EB8A0.D3A3FD09@vhb.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 212.199.57.205 X-Trace: dnews 1007616961 212.199.57.205 (5 Dec 2001 21:36:01 -0800) Lines: 31 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!130.133.1.3!fu-berlin.de!news.uni-paderborn.de!newsfeed01.sul.t-online.de!t-online.de!dnews