Article View: borland.public.jbuilder.java.api
Article #1573Re: win32 API calls
From: TBerry
Date: Thu, 06 Dec 2001 20:04
Date: Thu, 06 Dec 2001 20:04
39 lines
1922 bytes
1922 bytes
Avi,
I left out a critical piece of info - I need to do this from the server
side. The "System.get...." method only gets the username from the computer
it's running on.
Tom
Avi Abrami wrote:
> 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:
<3C0FCF53.5EC7DEA1@vhb.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!fu-berlin.de!news.uni-paderborn.de!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3C0EB8A0.D3A3FD09@vhb.com> <3C0F044B.49AD7499@intersystemsww.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-06 12:10:42 PST Message-ID: <3C0FCF53.5EC7DEA1@vhb.com> Date: Thu, 06 Dec 2001 15:04:35 -0500 From: TBerry <tberry@vhb.com> X-Mailer: Mozilla 4.75 [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> <3C0F044B.49AD7499@intersystemsww.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 204.243.174.175 X-Trace: dnews 1007668758 204.243.174.175 (6 Dec 2001 11:59:18 -0800) Lines: 40 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!fu-berlin.de!news.uni-paderborn.de!newsfeed01.sul.t-online.de!t-online.de!dnews