Results 1 to 4 of 4

Thread: [RESOLVED] Current User Loged In

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2006
    Posts
    56

    Resolved [RESOLVED] Current User Loged In

    I know you did this onece befor but i cant find that post anymore.
    Is there a auto trim on these forms?

    Anyways.. I got this as code but its not displaying the current user loged into windows.

    VB Code:
    1. Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
    2.  
    3.  
    4.  
    5. Private Sub Form_Load()
    6.     Message.Caption = "Welcome " & CurrentUser
    7.     End Sub

  2. #2

    Thread Starter
    Member
    Join Date
    Aug 2006
    Posts
    56

    Re: Current User Loged In

    Please Delete.

  3. #3
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: [RESOLVED] Current User Loged In

    VB Code:
    1. Private Sub Form_Load()
    2.     Dim sBuffer As String * 255
    3.    
    4.     GetUserName sBuffer, Len(sBuffer)
    5.     Debug.Print Left$(sBuffer, InStr(sBuffer, vbNullChar) - 1)
    6. End Sub

  4. #4
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: [RESOLVED] Current User Loged In

    You can achive this also like this:

    VB Code:
    1. MsgBox Environ("USERNAME")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width