Tulpep / Active-Directory-Object-Picker

The standard Active Directory object picker dialog for .NET
Other
87 stars 20 forks source link

Get Domain+username when select users #43

Open Th3AnG3L opened 2 years ago

Th3AnG3L commented 2 years ago

Hello when i select the users from the dialogbox and click ok button, it just display the username how to add it full path/name (domain)

When select Name | Folder Path in dialogbox to save information in combobox1.Items.Add with result: Folder\Name so it will be result like: Domain\Administrator how i can make that in code?

Th3AnG3L commented 2 years ago

So there should be a way to get last Domain/Name from Path only. Any ideas how to do it with this library?

    Using picker
        If picker.ShowDialog() = DialogResult.OK Then
            For Each sel In picker.SelectedObjects
                Dim aString As String = Replace(sel.Path, "WinNT://WORKGROUP/", String.Empty)
                Dim cString As String = Replace(aString , "/", "\")
                ComboBox1.Items.Add(cString)
                'MsgBox(sel.Path)
            Next
        End If
    End Using