使用 C# 是否可以将 ping 从运行 Windows Mobile 的设备发送到另一台计算机?
谢谢
There's nothing built into the Compact Framework.
OpenNETCFs SDF contains the ping class. It's located under the OpenNETCF.Net.NetworkInformation namespace. Check out the link to OpenNETCF SDF to see the licensing options (including the Community Edition which seems to be free to use as far as I can see).
如果你不想使用 OpenNetCF,你可以像这个例子中那样做:
http://www.hjgode.de/wp/2014/08/29/mobile-development-pingng-the-next-generation-ping/#more-1965
编辑:抱歉,这个也使用 OpenNetCf,但它是一个很好的例子,如何实现 ping 工具。
IcmpSendEcho
如果您想在没有任何第三方库的情况下发送 ping,您也可以 P/Invoke 。