我正在使用适用于Windows Phone 8.1的Visual Studio 2013 Express开发一个应用程序,当我想创建一个使用Ping对象的函数时,Visual Studio找不到此对象,我在MSDN上搜索文档,但没有发现任何问题因为这些示例使用相同的方法,并且表明与Windows Phone 8.1兼容。
使用语句:
using System.Net.NetworkInformation;
和变量的声明:
Ping somevar = new Ping();
我在NetworkInformation上仅看到两个类:NetworkChange和NetworkInterface。
我做错了什么?
请检查MSDN上Ping类的文档。在“版本信息和平台”部分的最后,您将找到受支持的框架和平台的列表:
.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)
这意味着Ping
Windows Phone不支持该类
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句