If you would like to make some extra cash for surfing the web, jump to http://www.codeoftheweek.com/paidsurf.html
In this issue we discuss how to retrieve the username used to login to Windows.
If you have any questions about using this module, let us know at questions@codeoftheweek.com
This module makes it easy to get the username used to login to Windows. This routine is most useful to avoid having to prompt your users with additional login information in your applications. You can use the built-in operating system security to provide authentication. This is most effective in Windows NT where security can be very high. One example of this is how Microsoft Outlook works.
Public Function LoginName() As String
Returns the username used to login to Windows. If an error occurs it will be raised to the calling routine.
Simply shows a message box with the current username.
MsgBox LoginName()
To see the source code for this issue you must be a subscriber to Code of the Week. If you are a subscriber the source code is available at the following address: http://www.codeoftheweek.com/membersonly/bi/0122.html
If you would like to get paid for surfing the web, jump to http://www.codeoftheweek.com/paidsurf.html