Results 1 to 3 of 3

Thread: Get Novell User Name

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 1999
    Posts
    154
    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

  2. #2
    Hyperactive Member
    Join Date
    May 2000
    Location
    Or
    Posts
    316
    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)

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 1999
    Posts
    154
    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
  •  



Click Here to Expand Forum to Full Width