>Wow--I'd been looking for a while and right after I posted this msg I think I found it--SYS(0). If anyone knows of another better one please let me know.
>
>JR
>
>>I have a client who's on W2K server. They want to create an audit trail in a program I wrote for them, which records user name. However, they don't want to have to have a log-in screen in the program I made (the network log-in is sufficient).
>>
>>How can I interrogate W2K to get the user name in VFP6?
>>
>>JR
There's also the Windows Script Host's WScript.Network object
oNet = CREATEOBJECT("WScript.Network")
? oNet.UserName
or the API
FUNCTION UserName
DECLARE INTEGER WNetGetUser IN Win32API;
STRING @lpszLocalName, STRING @lpszUserName,;
INTEGER @lpcchBuffer
LOCAL lcresult, lnpt, lnargs
lcresult = SPACE(200)
= WNetGetUser(0, @lcresult, LEN(lcresult))
lnpt = AT(CHR(0), lcresult)
IF lnpt > 1
lcresult = LEFT(lcresult, lnpt - 1)
ELSE
lcresult = ""
ENDIF
RETURN lcresult
ENDFUNC
George
Ubi caritas et amor, deus ibi est