在 Mono for Android 中,我正在尝试获取本地网络中我的设备的所有 IP 地址。
我不介意环回,但我对调用 DNS 不感兴趣。
最好的方法似乎是调用...
using System.Net.NetworkInformation;
NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces();
...除了抛出...
System.EntryPointNotFoundException: getifaddrs
有什么建议吗?
最佳答案
不幸的是,这是 Android 版 Mono 中的一个已知错误。错误报告可用 here .
关于c# - GetAllNetworkInterfaces() 抛出异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9973980/