Results 1 to 9 of 9

Thread: Grabbing the username

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2004
    Location
    North east UK
    Posts
    129

    Grabbing the username

    Hi All,

    can anyone tell me how i can grab the username of the currently logged in user. I did this for a system running on NT4 but it has not transferred across to the 2000 platform.

    Many thanks

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    What code were you using? You can normally transfer the networking API code across from VB6 fairly easily.
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  3. #3
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682
    Environment.Username()

    Gets the name of the dude that started the current thread.
    I don't live here any more.

  4. #4
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Originally posted by wossname
    Environment.Username()

    Gets the name of the dude that started the current thread.
    But under NT once can start a process under a different username
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  5. #5
    Fanatic Member pax's Avatar
    Join Date
    Mar 2001
    Location
    Denmark
    Posts
    840
    Hi.

    In that case, use SystemInformation.UserName

    According to the help, it should return the user currently logged on to the system.
    I wish I could think of something witty to put in my sig...

    ...Currently using VS2013...

  6. #6
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682
    Originally posted by plenderj
    But under NT once can start a process under a different username
    I did always despise NT with a passion.
    I don't live here any more.

  7. #7
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Originally posted by wossname
    I did always despise NT with a passion.
    NT is the future my friend
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  8. #8
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682
    Atari ST's are coming back too.
    I don't live here any more.

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Jan 2004
    Location
    North east UK
    Posts
    129
    thanks for your help everyone,

    apologies for the delay in replying, i have been working away. I will try migrating my existing code and try some of the options you have suggested.

    Col

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