_Application2.IsDestinationReachable(String) 方法

定义

获取一个值,指明从客户端计算机是否可以连接到目标计算机的指定统一资源定位器 (URL)、通用命名约定 (UNC) 路径或 IP 地址。

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

指定要检查网络连接的位置。 IP 地址、UNC 路径或 URL 都是可以接受的值。

返回

如果目标计算机可以访问,则为 true;否则,为 false

注解

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

重要提示:此成员只能由与当前打开的窗体在同一域中运行的表单访问,或者由已授予跨域权限的表单访问。

适用于