Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Find the Login Name of the Windows in which you ar...
Author:
Gagan Bhargava
E-mail:
Click to e-mail author
Submitted:
10/16/2001
Version:
VB6
Compatibility:
VB6
Category:
Windows API
Views:
12894
Find the Login Name of the Windows in which you are working....
Declarations:
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Code:
Public Function myUserName() Dim m_myBuf As String * 25 Dim m_Val As Long, UserName As String m_Val = GetUserName(m_myBuf, 25) UserName = Left(m_myBuf, InStr(m_myBuf, Chr(0)) - 1) MsgBox UserName End Function Private Sub Form_Load() myUserName End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement