问题
After several hours of searching it appears that there is no way to query a local LDAP directory (Microsoft Active Directory or otherwise) from a UWP app.
This seems like a rather bizarre hole in the UWP offering, and so I'm hopeful that I'm just missing the obvious.
What (if anything) is the functional equivalent of System.DirectoryServices in the Universal Windows Platform world?
回答1:
This thread is a little older, but you have 3 options today:
Use the Windows Compatibility Pack for .NetCore - https://blogs.msdn.microsoft.com/dotnet/2017/11/16/announcing-the-windows-compatibility-pack-for-net-core/
Use the Desktop Bridge to create a .Net component that does your LDAP queries. see http://aka.ms/desktopbridge for more information
If you can, move to the Microsoft Graph - links to samples:
- https://github.com/search?q=uwp+sample+user:microsoftgraph&type=Repositories
Hope this helps, Adam Braden [MS]
回答2:
System.DirectoryServices is not available in the UWP, but if you are using sideloading for your app then you can use Brokered windows component to get or create the details required through a endpoint in it.
https://docs.microsoft.com/en-us/windows/uwp/winrt-components/brokered-windows-runtime-components-for-side-loaded-windows-store-apps
来源:https://stackoverflow.com/questions/39701898/ldap-queries-using-uwp-on-windows-10-iot