构建后 Codeplex ADUI 对象选取器出现问题

发布于 2024-12-22 21:54:26 字数 1146 浏览 0 评论 0原文

我正在尝试使用 Codeplex 中的 Active Directory 对象选取器 来打开用户和用户组对话框。

如果在 VS2010 的调试模式下运行,它工作得很好,但是当运行解决方案的发行版时,打开对话框 2 或 3 次后,它会打开,但没有一个按钮响应单击(您可以看到它们被按下,但不要激活任何东西)。什么都没有。它没有卡住。它只是不响应任何按钮上的任何点击。关闭它的唯一方法是从任务管理器中终止该进程。

我已经使用 C# VS2010 在 Win7 x64 计算机上创建并运行了该解决方案。 构建是任何CPU。

DirectoryObjectPickerDialog picker = new DirectoryObjectPickerDialog();
picker.AllowedObjectTypes = ObjectTypes.Computers;
picker.DefaultObjectTypes = ObjectTypes.Computers;
picker.AllowedLocations = Locations.GlobalCatalog;
picker.DefaultLocations = Locations.GlobalCatalog;
picker.MultiSelect = true;
DialogResult dialogResult = picker.ShowDialog();
if (dialogResult == DialogResult.OK)
{
    DirectoryObject[] results;
    results = picker.SelectedObjects;
    if (results == null)
        return;

    for (int i = 0; i <= results.Length - 1; i++)
    {
        ListViewItem theItem = new ListViewItem(results[i].Name);
        LvServersNames.Items.Add(theItem);
    }

    LblTotalServers.Text = "Server(s) : " + results.Length.ToString();
}

picker.Dispose();
picker = null;

I'm trying to use the Active Directory Object Picker from Codeplex to open the users & groups dialog box.

It is working great if running during debug mode from VS2010, but when running the release of the solution, after 2 or 3 times opening the dialog box, it opens but non of the buttons are responding to clicks (you can see they are pressed but don't activate anything). Nothing at all. its not stuck. its just not responding to any of the clicks on any button. the only way to close it is to kill the process from task manager.

I've created and running the solution on a Win7 x64 machine using C# VS2010.
The build is Any CPU.

DirectoryObjectPickerDialog picker = new DirectoryObjectPickerDialog();
picker.AllowedObjectTypes = ObjectTypes.Computers;
picker.DefaultObjectTypes = ObjectTypes.Computers;
picker.AllowedLocations = Locations.GlobalCatalog;
picker.DefaultLocations = Locations.GlobalCatalog;
picker.MultiSelect = true;
DialogResult dialogResult = picker.ShowDialog();
if (dialogResult == DialogResult.OK)
{
    DirectoryObject[] results;
    results = picker.SelectedObjects;
    if (results == null)
        return;

    for (int i = 0; i <= results.Length - 1; i++)
    {
        ListViewItem theItem = new ListViewItem(results[i].Name);
        LvServersNames.Items.Add(theItem);
    }

    LblTotalServers.Text = "Server(s) : " + results.Length.ToString();
}

picker.Dispose();
picker = null;

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

心奴独伤 2024-12-29 21:54:26

BOITE DE DIALOGUE D'OBJET - DIRECTORY OBJECT PICKER 它是法语的,但它对我来说效果很好。

BOITE DE DIALOGUE D'OBJET - DIRECTORY OBJECT PICKER it's in french, but it works fine for me.

小梨窩很甜 2024-12-29 21:54:26

查看 Codeplex 上的讨论部分。有一个专门关于在 x64 上运行代码的问题,基本上你必须按照说明进行一些修改,但它工作正常。请参阅:

http://adui.codeplex.com/discussions/38047?ProjectName=adui

不过,请注意 - 如果您需要返回所选对象的 SID,那么在放弃之前您可能会像我在对话框中得到的那样。在某些操作系统上,接口之一的错误意味着如果您指定扩展属性(必须这样做才能获取 SID),则无法将数据编组回 .NET。请参阅 http://msdn.microsoft .com/en-us/library/windows/desktop/ms676013(v=vs.85).aspx

Have a look at the discussions section on Codeplex. There's a question specifically about running the code on x64, basically you have to make a few hacks as per the instructions, but it works OK. See:

http://adui.codeplex.com/discussions/38047?ProjectName=adui

A word of warning though - if you need to return the SID of the selected object(s), you'll probably then get as far as I got with the dialog before giving up. On certain operating systems, a bug with one of the interfaces means that it's impossible to marshal the data back to .NET if you specify extended attributes (which you have to in order to get SIDs). See http://msdn.microsoft.com/en-us/library/windows/desktop/ms676013(v=vs.85).aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文