Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/266.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows mobile C#根据Active Directory验证用户名和密码?_C#_Active Directory_Windows Mobile - Fatal编程技术网

Windows mobile C#根据Active Directory验证用户名和密码?

Windows mobile C#根据Active Directory验证用户名和密码?,c#,active-directory,windows-mobile,C#,Active Directory,Windows Mobile,我尝试根据Windows Mobile设备的活动控制器验证用户名和密码。在XP上,我使用以下命令: using System.Security; using System.DirectoryServices; using System.DirectoryServices.ActiveDirectory; ... DirectoryEntry entry = new DirectoryEntry(srvr, usr, pwd); ob

我尝试根据Windows Mobile设备的活动控制器验证用户名和密码。在XP上,我使用以下命令:

    using System.Security;
    using System.DirectoryServices;
    using System.DirectoryServices.ActiveDirectory;
    ...
    DirectoryEntry entry = new DirectoryEntry(srvr, usr, pwd);
            object nativeObject = entry.NativeObject;
    ...
但这些在Windows Mobile中不可用

在Windows Mobile中有没有办法做到这一点


感谢您,.NET Compact Framework不支持LDAP(因此Active Directory身份验证)

不过,您可以使用p/invoke从.Net调用本机方法。下面的链接提供了一个如何通过C++来实现的例子。

似乎OP发布了一些非常接近的代码,但他有一个呼叫约定
Cdecl
,我在Windows Mobile下只能看到
Winapi
。我该怎么办?不,我没有。谢谢(以前忘了给你+1,但现在已经在那里了)。然而,我似乎无法让呼叫约定按照OP的回答中所述的方式工作(参见我的评论)。