Results 1 to 8 of 8

Thread: Show the Window's "Select User or Group" dialog box

  1. #1

    Thread Starter
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,695

    Question Show the Window's "Select User or Group" dialog box

    Hi,

    Does anyone knows how to display the Window's "Select User or Group" dialog box through C# or VB.NET and then retrieve whatever value it returns upon pressing the OK button?

    You can normally see this dialog through many places and most common being,

    * Open Windows Explorer
    * Locate any folder
    * Right click on the folder and click properties
    * Go to the "Security" tab and click on the "Advanced" button at the bottom right of the dialog
    * There you can see the "Add", "Edit", "Remove" buttons for mucking around with permissions
    * Click on the "Add" button

    Now that will bring on the dialog I am after. I need to show that dialog via code and when the user press OK after selecting a user or group I need to retrieve what that value it.

    What I have is an application where a user's fully qualified domain name is stored in the SQL Server database where it's used throughout for auditing purposes and also defining our own set of security on the program which isn't always possible even by grouping users at the domain level.

    Is this possible?

    Cheers

  2. #2

    Thread Starter
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,695

    Re: Show the Window's "Select User or Group" dialog box

    Not to be noisy but *BUMP*

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: Show the Window's "Select User or Group" dialog box

    Even if you can display the dialogue, getting the user's selection would not be easy. I'd think it would be a better idea to just create your own dialogue.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  4. #4

    Thread Starter
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,695

    Re: Show the Window's "Select User or Group" dialog box

    Thanks J.

    Yeah I thought about it and doing that would be easy, I just thought if I am using the inbuilt functionality of Windows then I don't have to worry about updating anycode when I am moving from Win2000 -> XP -> Vista (assuming the core APIs are same).

    I am still keeping my option open by invoking the OS dialog and will see if I can find a solution. When I do I will reply to this post so can be useful to others.

    Cheers

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: Show the Window's "Select User or Group" dialog box

    In actual fact there's every possibility that the functionality would change betweeb XP and Vista. If you access AD via .NET then you are assured that it will work for all OSes.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  6. #6

    Thread Starter
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,695

    Re: Show the Window's "Select User or Group" dialog box

    Quote Originally Posted by jmcilhinney
    In actual fact there's every possibility that the functionality would change betweeb XP and Vista. If you access AD via .NET then you are assured that it will work for all OSes.
    Absolutely on the mark John.

    Yes I know that there is a real high chance of things changing between XP and Vista, what I meant to say was if I use .NET way which internally might be using one of the OS APIs but so long the .NET Framework is updated, it would know how to take care of OS differences.

    So yes I am looking for a .NET way of achieving this.

  7. #7
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: Show the Window's "Select User or Group" dialog box

    As I said, you should use AD. That's ActiveDirectory, for which the Framework provides an API. You can get a list of users and groups from AD and display them in your own dialogue.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  8. #8

    Thread Starter
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,695

    Re: Show the Window's "Select User or Group" dialog box

    Yes thanks John. I am already coding to achieve this using active directory APIs included in .NET Framework.

    Just keeping an option open on achieving my main goal using the .NET Framework, if possible ofcourse.

    Thanks for the suggestions and input mate

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