>In Visual Fox, the function sys(0) will return the user's logon name. Is there a similar function available in Visual Basic? I hope I don't have to go into Win API just to get the user's name.
The code to get the WIndows login name through the API is pretty trivial in VB:
FromDan Appleman's Book
Visual Basic Programmer's Guide to the Win32 APIDeclare Function GetUserName& Lib "advapi32.dll' Alias "GetUsernameA" _
(ByVal lpBuffer As String, nSize as Long)
DIM S$, cnt&, dl&
cnt& = 199
S$ = STRING$(200,0)
dl& = GetUserName(s$, cnt)
s$ = Left$(s$,cnt)
Not much more than calling SYS(0) and stripping the machine name if it's present conditionally; it's roughly the same code in VFP using the API, and the API code isn't affected by whether or not you're on a network.
If you don't have Appleman's book, get it - it's probably the most intelligible thing on the Win32 API out now unless you're at least passingly familiar with C/C++.