Obtaining Network User IDs from Within FoxProLast reviewed: October 18, 1996Article ID: Q99921 |
The information in this article applies to:
SUMMARYTo create unique filenames based on individual workstation operators, each user's identification (ID) must be obtained from the environment. Third-party API libraries that can interface with the network to provide this information are available; however, you can also use a batch file to capture the user IDs during interactive logins if only medium security is required.
MORE INFORMATIONTo capture a user ID, you must create a batch file with the same name as the command normally executed to log in. For example, if the normal method is to type LOGIN followed by an ID, the batch file would be named LOGIN.BAT. To create the file:
If the network LOGIN file is found through the MS-DOS PATH statement, place LOGIN.BAT in the root directory so that it will be executed first. However, if the AUTOEXEC.BAT selects the subdirectory where the original LOGIN program is found, you need to modify AUTOEXEC.BAT to find LOGIN.BAT first. For added security, you can mark the LOGIN.BAT file as Hidden with the MS-DOS ATTRIB command. Once the login is finished and FoxPro is running, the ID can be retrieved with the GETENV() function. The following commands demonstrate its usage:
usrname=GETENV("USER")The variable usrname contains the user ID.
|
Additional reference words: 5.00 VFoxWin 3.00 FoxDos FoxWin 2.00 2.50 2.50a
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |