Hi,
Do any of you know how to get the User Name from Novell, like the whoami command? Or is there another way to get this info (that I'm obviously not aware of)?
Thanks,
Emmet.
Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig
This tip was submitted by Ashley Levin.
The following code shows how to access the Novell API and get the usename.
Declare the following external functions:
function ulong NWInitialize() library "NWInfo"
function ulong NWGetInfo( Long Drv, Long info, ref string buffer ) Library "NWInfo"
Then declare a function and add the following code:
// i_sys=1 - novell
string login_name
string ls_temp
integer drv,info
long l_ret
login_name = "user_name_error"
if i_sys = 1 then // novell login name.
l_ret = NWInitialize() // init the dll, check for client 32 ...
if l_ret = 0 then
drv = 7 // network drive g:
info = 35 // typeless user name
ls_temp = Space( 129 )
// get the login name for specific drive
l_ret = NWGetInfo( drv, info, ls_temp )
if l_ret = 0 then
login_name = Trim( ls_temp )
end if
end if
end if
return login_name
emmetkelly wrote:Thanks, Marten. I'll try that.
However, can it not just be done through Smalltalk?
Return to VA Smalltalk 7.0, 7.5 & 8.0
Users browsing this forum: Yahoo [Bot] and 1 guest