Howdy, Stranger!

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

Categories

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

  • KDivad LeahcimKDivad Leahcim Member Posts: 3,948
    : 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?
  • Sparky ProggerSparky Progger Member Posts: 12
    : : 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!)

  • GameTroyGameTroy Member Posts: 214
    : : : 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



  • KDivad LeahcimKDivad Leahcim Member Posts: 3,948
    : : : : 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]
  • Sparky ProggerSparky Progger Member Posts: 12
    : : : : : 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

  • Justin BibJustin Bib USAMember Posts: 0

    ________ | http://forcoder.org | free video tutorials and ebooks about [ Java Perl Swift Assembly JavaScript PHP Scratch Ruby R C++ Go Delphi Visual Basic .NET C Objective-C MATLAB Python PL/SQL Visual Basic C# F# Kotlin Crystal Ada Erlang COBOL Lua Logo Clojure Prolog SAS Dart LabVIEW Bash FoxPro Lisp Apex Rust Julia ABAP Scheme Alice Fortran Awk Scala ML Hack Transact-SQL D VBScript ] ______

Sign In or Register to comment.