|
-
Jun 26th, 2000, 12:33 AM
#1
Thread Starter
Addicted Member
I need to get the users name from Novell. I have downloaded the NWSess.OCX. However, I am not familiar with it but it doesn't seem to work. I don't want the user to sign in a second time to my application. I simply want to get the username that is already signed in to Novell prior to the user opening my app.
Thanks
-
Jun 26th, 2000, 01:51 AM
#2
Hyperactive Member
I don't think that this technically returns the Novell user name, but it does return the username of the user that the network connection was established under. So in my office, the two are always the same, so it seems to have the same effect.
Code:
Private Declare Function WNetGetUser Lib "mpr.dll" _
Alias "WNetGetUserA" (ByVal lpName As String, _
ByVal lpUserName As String, lpnLength As Long) As Long
Const NoError = 0
Sub GetUserName()
Const lpnLength As Integer = 255
Dim status As Integer
Dim lpName, lpUserName As String
lpUserName = Space$(lpnLength + 1)
status = WNetGetUser(lpName, lpUserName, lpnLength)
If status = NoError Then
lpUserName = Left$(lpUserName, InStr(lpUserName, Chr(0)) - 1)
Else
MsgBox "Unable to get the name."
End
End If
MsgBox "Logged Username: " & lpUserName
End Sub
Private Sub Command1_Click()
GetUserName
End Sub
Hope this can help
(Using VB 6 SP 3)
-
Jun 26th, 2000, 02:27 AM
#3
Thread Starter
Addicted Member
This will get me the userID in our environment. However, I need the user name which is stored on Novell.
Thanks for the reply.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|