Windows 10 通用应用程序中的 ICMP [英] ICMP in Windows 10 Universal Apps

查看:30
本文介绍了Windows 10 通用应用程序中的 ICMP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够通过 Windows 10 通用应用程序进行一些 ICMP 网络诊断,包括 ping、traceroute 等.

I would like to be able to do some ICMP network diagnostics from a windows 10 universal app, including ping, traceroute, etc.

但是,System.Net.NetworkInformation.Ping 类似乎无法用于存储应用程序和创建新的 System.Net.Sockets.Socket当我尝试时,ProtocolType.Icmp 不可用.

However it would appear that the System.Net.NetworkInformation.Ping class isn't available to store apps and when creating a new System.Net.Sockets.Socket the ProtocolType.Icmp is not available when I try.

我在 Internet 上可以找到的有关此主题的所有信息都与 Windows 8.1 应用程序有关,我想知道是否在 Windows 10 中的 API 中添加了任何新内容,以允许我生成 ICMP ping 等.

All the information I can find on the Internet about this topic all relates to windows 8.1 apps and I want to know if anything new has been added to the API in Windows 10 that would allow me to produce ICMP ping, etc.

我看到有人建议您可以使用原始套接字,但似乎在客户端版本的 Windows 上不再允许使用这些套接字.

I've seen suggestions that you could use raw sockets but it appears that these are no longer allowed on client versions of Windows.

我的首选语言是 C#,但如果这给我带来优势,我也可以使用 C++.

My preferred language is C# but I'm OK with using C++ if this gives me an advantage.

注意:检查网络状态是不够的.我实际上想测试与网络上特定机器的连接,我真的想要一个正确的 ICMP ping.

Note: checking the network status is not sufficient. I'm actually wanting to test the connection to specific machines on the network, I really do want a proper ICMP ping.

推荐答案

System.Net.NetworkInformation.Ping dot net 类是 Win32 IP Helper Functions 的包装器.

The System.Net.NetworkInformation.Ping dot net class is a wrapper for the Win32 IP Helper Functions.

UWP 应用在受保护的环境中运行,因此,许多可能危及平台安全的 Win32、COM 和 CRT API 调用是不被允许的.

UWP Apps run in a protected environment, and as a result, many Win32, COM, and CRT API calls that might compromise the security of the platform are not allowed.

Windows 运行时应用和通用 Windows 平台 (UWP) 应用可以使用 Win32 和 COM API 的子集,您可以在本机应用中调用这些 API.

Windows Runtime apps and Universal Windows Platform (UWP) apps can use a subset of the Win32 and COM APIs which you can call in a native app.

遗憾的是,UWP 尚不支持 Win32 IP Helper 函数.

Unfortunately, the Win32 IP Helper Functions are not supported in UWP yet.

这篇关于Windows 10 通用应用程序中的 ICMP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆