Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Machine dependent SYS(0)/NT 4.0 Problem
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00137717
Message ID:
00137873
Views:
17
I see. I use getenv("USERNAME") to lookup a user's name and set a property that is used when generating unique codes in different spots in our application. Do you know what function will return the username of the current user logged into NT?

Thanks.



>>The function getenv("USERNAME") will get you the name of the user who is logged-on...
>
>Actually, unless you do something during a login script to initialize the DOS environment variable USERNAME, it won't be set; in addition, as an environment string, it's editable. GetComputerName() returns the actual NetBIOS name of the station, and that can't be changed by the user during a session without causing the system to reboot.
>
>>
>>>>I have a problem that appears to be machine dependent. I am using SYS(0) to get the current login and use that to look up names in a table to set privileges on the menu. I've been using this same technique for several years with no problems.
>>>>
>>>>On my most recent application (VFP 5.0a), the program cannot associate the login with the names in the table on two of ten machines. All are running NT 4.0 SP3. The offending machines will not recognize any logins, the working machines will recogize all logins so I don't think it's a matter of errors in the table names or the code that parses the SYS(0) string.
>>>>
>>>>Anyone seen this before? TIA
>>>
>>>Instead of SYS(0), try using the API call GetComputerName() to retrieve the NetBIOS name of the machine.
Joseph C. Kempel
Systems Analyst/Programmer
JNC
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform