Results 1 to 5 of 5

Thread: Know which user has logged on system

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2001
    Posts
    27

    Smile Know which user has logged on system

    how can i know through any api or vb function that which user has been logged on the system?
    And is there any way to restrict a user from using any file or a folder?

  2. #2
    jim mcnamara
    Guest
    Code:
    Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long 
    
    Function usrName() as String
        Dim uname as string , rval as long, strlen as long
        uname = space(255)
        rval = GetUserName(uname,strlen)
        usrName = left(uname,strlen)
    End Function

  3. #3
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    And is there any way to restrict a user from using any file or a folder?
    You using NT/2000?
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  4. #4
    jim mcnamara
    Guest
    JoshT didn't mention - The answer is "no" id you're on a Win 9X machine. I don't know how to do it from code on NT. Guess I'll go figure it out....

  5. #5
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    probably by using the SetFileSecurity API, i'll look into it.
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

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