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?
Printable View
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?
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
You using NT/2000?Quote:
And is there any way to restrict a user from using any file or a folder?
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....
probably by using the SetFileSecurity API, i'll look into it.