Mail Archives: djgpp/1998/04/05/12:15:26
From: | sylvainp AT mypc DOT com
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Getting the user name from the OS
|
Message-ID: | <3527ab23.4874700@news.microtec.net>
|
Lines: | 25
|
Date: | Sun, 05 Apr 1998 16:02:17 GMT
|
NNTP-Posting-Host: | as51-20-ppp3.mtl.microtec.net
|
NNTP-Posting-Date: | Sun, 05 Apr 1998 12:02:17 EST
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Hello all.
I'm just starting with DJGPP and I don't have that much experience in
C.
I need to know if it's possible (in a dos session under Win95 in a
network environment) to check who is currently using the machine (i.e.
the last user that logged on), I've figured on how to get the name of
the machine itself but not the name of the user who is currently
logged in. This is to write a routine what will only be accessible to
authorised users without having to prompt them for their names a
second time (they already typed it in when booting the machine).
There's a function I've tried, but it needs to read the name from an
environmentat variable, otherwise it returns 'dosuser' os something
like that.
If I can't do it this way, I'll have to ask the MIS to provide me a
drive on the newtwork that only the people I want can access, but I
don't like this solution.
We're using TCPIP for our network and the servers run under NT.
Thanks in advance.
- Raw text -