gpt4 book ai didi

c# - 为什么在 C# 中看不到 Ping 类?

转载 作者:太空宇宙 更新时间:2023-11-03 10:37:16 25 4
gpt4 key购买 nike

我在 Visual Studio 2013 Express for Windows Phone 8.1 中制作一个应用程序,当我想制作一个函数来使用 Ping 对象时,Visual Studio 没有找到这个,我在 MSDN 上搜索文档但我没有发现错误,因为示例使用相同的方式并说明与 Windows Phone 8.1 兼容。

使用语句:

using System.Net.NetworkInformation;

和变量的声明:

Ping somevar = new Ping();

我在 NetworkInformation 中只看到两个类:NetworkChange 和 NetworkInterface。

我做错了什么?

最佳答案

请查看类 Ping on MSDN 的文档.在版本信息和平台部分的末尾,您将找到支持的框架和平台列表:

.NET Framework
Supported in: 4.5.3, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile
Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7,
Windows Vista SP2, Windows Server 2008 (Server Core Role not supported),
Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

这意味着 Windows Phone 不支持 Ping

关于c# - 为什么在 C# 中看不到 Ping 类?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27210623/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com