2014-02-26 56 views
-2
using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using System.Threading.Tasks; 
using System.Net.NetworkInformation; 

IPAddress ip = IPAddress.Parse 

由於Ping不存在,IPAddress不存在。 我試圖添加System.Net的引用沒有工作。爲什麼使用System.Net.NetworkInformation.Ping Ping不存在?

我的VS是在.NET 4.5

+2

添加'使用System.Net;' –

回答

2

IPAddress classSystem.Net命名空間下,所以你應該導入命名空間:

using System.Net; 

您已經導入System.Net.NetworkInformation但它是完全不同的命名空間。