_NetworkState.IsDestinationReachable(String) 方法

定义

获取一个值,该值指示能否与指定的网络目标建立连接。

public:
 bool IsDestinationReachable(System::String ^ bstrDestination);
public bool IsDestinationReachable (string bstrDestination);
abstract member IsDestinationReachable : string -> bool
Public Function IsDestinationReachable (bstrDestination As String) As Boolean

参数

bstrDestination
String

指定要检查网络连接的位置,此位置可以是统一资源定位器 (URL)、通用命名约定 (UNC) 路径或 IP 地址。

返回

如果可以与指定的 URL、UNC 路径或 IP 地址建立连接,则返回 true;否则,将返回 false

注解

bstrDestination 指定的值必须是包含服务器名称和共享名称的 UNC 路径,例如 @“\\MyServer\MyShare”,或者以以下协议标识符之一开头的 URL:http、https 或文件。

适用于