简体   繁体   中英

Windows mobile C# Validate a username and password against Active Directory?

i try to validate the username und password against Active Director from a Windows Mobile devive. On XP I use this:

    using System.Security;
    using System.DirectoryServices;
    using System.DirectoryServices.ActiveDirectory;
    ...
    DirectoryEntry entry = new DirectoryEntry(srvr, usr, pwd);
            object nativeObject = entry.NativeObject;
    ...

but these are not available in Windows Mobile.

Is there a way to do this in Windows Mobile?

Thanks

The .NET Compact Framework doesn't support LDAP (therefore Active Directory Authentication).

You can use P/invoke to call the native methods from .Net though. An example on how to do it via C++ is provided in the link below.

http://msdn.microsoft.com/en-us/library/aa912620.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM