是否有可能写在C#中一平一类,将Windows 8的地铁环境中运行? [英] Is it possible to write a Ping class in C# that will run within Windows 8 Metro environment?

查看:91
本文介绍了是否有可能写在C#中一平一类,将Windows 8的地铁环境中运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于在Windows 8地铁环境缺乏大多数.NET框架类库或包含substancially缩减下来的版本,是否有可能执行的ping从Metro风格的应用程序?没有为套接字的支持,所以我想是有希望的,但我不知道从哪里开始,因为每一个C#平的例子使用的 System.Net.NetworkInformation.Ping ,这是不具备的WinRT的。

Since the Metro environment on Windows 8 lacks most of the .NET framework class libraries or contains a substancially pared down version, is it possible to execute a "ping" from a Metro style application? There is support for Sockets, so I guess there is hope, but I don't know where to start, since every "C# Ping" example uses System.Net.NetworkInformation.Ping and that is not available in WinRT.

我也看了成单声道的源代码,他们的平实施了火灾和PING.EXE返回命令行的标准输出窗口中的结果。

I also looked into the source code for Mono, and their ping implementation fires up ping.exe and returns the result from the standard output window of the command line.

推荐答案

没有,可惜没有。 ICMP不支持WinRT中: IcmpCreateFile 及相关的Win32 API仅在桌面API分区可用。 ICMP可以使用原始套接字实现,但因为这些不WinRT的支持(通常需要提升,无论如何),这个选项也不能提供给你。

No, unfortunately not. ICMP is not supported in WinRT: IcmpCreateFile and related Win32 APIs are only available in the "desktop" API partition. ICMP can be implemented using raw sockets but since these are not supported in WinRT (and usually require elevation, anyway), this option is also not available to you.

由于一个Windows应用商店的网络扫描工具自己( http://lanscan.rcook.org/ ),我的开发人员ð爱能够做到这一点。

As the developer of a Windows Store network scanning tool myself (http://lanscan.rcook.org/), I'd love to be able to do this.

这篇关于是否有可能写在C#中一平一类,将Windows 8的地铁环境中运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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