Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Where does SYS(0) get it's information

Status
Not open for further replies.

StewartUK

Programmer
Feb 19, 2001
860
GB
Hi,

I use SYS(0) to return a user's Network logon and computer name.

I have also been using it on stand alone computers and, with a little decoding in my program it has worked fine until now. Someone had a problem that requried a restart and after they had re-started, SYS(0) is returning a blank as the username although my user tells me that then entry in HKEY_LOCAL_MACHINE\Network\Logon still reads what it should!

So does anyone know where SYS(0) looks in the registry?

Thanks,

Stewart
 
Prior to this question, I had always assumed VFP was making a call to the GetUserName and GetComputerName API functions.

However, after running a registry trace utility, I was unable to capture VFP reading this info from the registry. While when I called the above API functions myself, I was able to determine they were obtaining the info from the following reg keys,repectively, on my Win98 SE machine:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control - username value
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ComputerName - computername value

So, AFA, where/how VFP gets the info, I dont know. You may need to consult the boys in Redmond.
But if it is obtaining it from the registry, its possible (even probable) that the registry key is going to vary from machine to machine, dependant on the OS. Jon Hawkins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top