UWP中的[UWP] [C#] System.Net.NetworkInformation.Ping类。 [英] [UWP][C#] System.Net.NetworkInformation.Ping class in UWP.
问题描述
我需要获得局域网的所有活动IP。我发现Ping类也是这样。
我使用nuget将System.Net.Ping包安装到我的UWP项目中并写下代码。
System.Net.NetworkInformation.Ping p = new System.Net.NetworkInformation.Ping();
          System.Net.NetworkInformation.PingReply rep = await p.SendPingAsync(IPaddress);
          if(rep.Status == System.Net.NetworkInformation.IPStatus.Success)
          {}
错误: System.IO.FileNotFoundException:'无法加载文件或程序集'系统.Net.Ping,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a'。系统找不到指定的文件。'
我收到此错误,无法使用UWP执行此操作。
sandeep chauhan
请看这个链接: https://social.msdn.microsoft.com/Forums/vstudio/en -US / 45e75273-2b87-44cd-86f8-84eb8b285a05 / uwpcusing-systemnetping合UWP-APP-VS-2017?论坛= wpdevelop
I need to get all active ip of LAN. I found Ping class to do same.
I installed System.Net.Ping package using nuget into my UWP project and write below code.
System.Net.NetworkInformation.Ping p = new System.Net.NetworkInformation.Ping();
System.Net.NetworkInformation.PingReply rep = await p.SendPingAsync(IPaddress);
if (rep.Status == System.Net.NetworkInformation.IPStatus.Success)
{}
ERROR: System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Net.Ping, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.'
I am getting this error and not able to do this using UWP.
sandeep chauhan
see this link:https://social.msdn.microsoft.com/Forums/vstudio/en-US/45e75273-2b87-44cd-86f8-84eb8b285a05/uwpcusing-systemnetping-in-uwp-app-vs-2017?forum=wpdevelop
这篇关于UWP中的[UWP] [C#] System.Net.NetworkInformation.Ping类。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!