User Name

Uhm...hehe...How the heck do I get my app to recognize which user is logging on??? (in other words: How do I return the username to my app?)

[b][red]Appreciation will be flooded over the one who can help me out[/red][/b] ;-)
[hr]
[b][red][size=4];-)..::Sparky::..;-)[/size][/red][/b]
[hr]

Comments

  • : Uhm...hehe...How the heck do I get my app to recognize which user is logging on??? (in other words: How do I return the username to my app?)
    :
    : [b][red]Appreciation will be flooded over the one who can help me out[/red][/b] ;-)
    : [hr]
    : [b][red][size=4];-)..::Sparky::..;-)[/size][/red][/b]
    : [hr]
    :

    API GetUserName

    Need help with it?
  • : : Uhm...hehe...How the heck do I get my app to recognize which user is logging on??? (in other words: How do I return the username to my app?)
    : :
    : : [b][red]Appreciation will be flooded over the one who can help me out[/red][/b] ;-)
    : : [hr]
    : : [b][red][size=4];-)..::Sparky::..;-)[/size][/red][/b]
    : : [hr]
    : :
    :
    : API GetUserName
    :
    : Need help with it?
    :
    Uhm... Yeah (I know practically nothing about API, thanks, man!)

  • : : : Uhm...hehe...How the heck do I get my app to recognize which user is logging on??? (in other words: How do I return the username to my app?)
    : : :
    : : : [b][red]Appreciation will be flooded over the one who can help me out[/red][/b] ;-)
    : : : [hr]
    : : : [b][red][size=4];-)..::Sparky::..;-)[/size][/red][/b]
    : : : [hr]
    : : :
    : :
    : : API GetUserName
    : :
    : : Need help with it?
    : :
    : Uhm... Yeah (I know practically nothing about API, thanks, man!)
    :
    :

    if i knew how to make my vb5 work with api's i would like that. but my computer doesn't like api's and always comes up with errors.


    Moses 1:39 - "For behold, this is my work and my glory-to bring to pass the immortality and eternal life of man.


    -Troy



  • : : : : Uhm...hehe...How the heck do I get my app to recognize which user is logging on??? (in other words: How do I return the username to my app?)
    : : : :
    : : : : [b][red]Appreciation will be flooded over the one who can help me out[/red][/b] ;-)
    : : : : [hr]
    : : : : [b][red][size=4];-)..::Sparky::..;-)[/size][/red][/b]
    : : : : [hr]
    : : : :
    : : :
    : : : API GetUserName
    : : :
    : : : Need help with it?
    : : :
    : : Uhm... Yeah (I know practically nothing about API, thanks, man!)
    : :
    : :
    :
    : if i knew how to make my vb5 work with api's i would like that. but my computer doesn't like api's and always comes up with errors.
    :
    :
    : Moses 1:39 - "For behold, this is my work and my glory-to bring to pass the immortality and eternal life of man.
    :
    :
    : -Troy
    :
    :
    :
    :
    Then you are probably using them incorrectly. What error do you get?


    Place this at the top of a module (form, bas, etc.):
    [code]
    Public Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
    [/code]
    If you place it in any place other than a .bas module, you must change Public to Private!

    Here's a simple wrapper function to get the username:
    [code]
    Public Function GetUser() As String

    Dim UName As String
    Dim x As Long
    x = 255
    UName = String$(x, 0)
    If GetUserName(UName, x) <> 0 Then GetUser = Left$(UName, x - 1)

    End Function
    [/code]
  • : : : : : Uhm...hehe...How the heck do I get my app to recognize which user is logging on??? (in other words: How do I return the username to my app?)
    : : : : :
    : : : : : [b][red]Appreciation will be flooded over the one who can help me out[/red][/b] ;-)
    : : : : : [hr]
    : : : : : [b][red][size=4];-)..::Sparky::..;-)[/size][/red][/b]
    : : : : : [hr]
    : : : : :
    : : : :
    : : : : API GetUserName
    : : : :
    : : : : Need help with it?
    : : : :
    : : : Uhm... Yeah (I know practically nothing about API, thanks, man!)
    : : :
    : : :
    : :
    : : if i knew how to make my vb5 work with api's i would like that. but my computer doesn't like api's and always comes up with errors.
    : :
    : :
    : : Moses 1:39 - "For behold, this is my work and my glory-to bring to pass the immortality and eternal life of man.
    : :
    : :
    : : -Troy
    : :
    : :
    : :
    : :
    : Then you are probably using them incorrectly. What error do you get?
    :
    :
    : Place this at the top of a module (form, bas, etc.):
    : [code]
    : Public Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
    : [/code]
    : If you place it in any place other than a .bas module, you must change Public to Private!
    :
    : Here's a simple wrapper function to get the username:
    : [code]
    : Public Function GetUser() As String
    :
    : Dim UName As String
    : Dim x As Long
    : x = 255
    : UName = String$(x, 0)
    : If GetUserName(UName, x) <> 0 Then GetUser = Left$(UName, x - 1)
    :
    : End Function
    : [/code]
    :
    Hey, thanks, man. I really appreciate that... Now I can get My app done. Besides, I've grown really fond of VB, and I mean REALLY, maybe I'll get an education on it! So, you've helped me on the way, [size=5][red]THANKS[/red][/size]

    -Sparky

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories