Muokkaa

Jaa


Network.IsAvailable Property

Definition

Indicates whether a computer is connected to a network.

public:
 property bool IsAvailable { bool get(); };
public bool IsAvailable { get; }
member this.IsAvailable : bool
Public ReadOnly Property IsAvailable As Boolean

Property Value

True if the computer is connected to a network; otherwise False.

Examples

This example checks the property's status and reports it.

If My.Computer.Network.IsAvailable = True Then
    MsgBox("Computer is connected.")
Else  
    MsgBox("Computer is not connected.")
End If

Remarks

IsAvailable always returns False when called from a Click Once application or if the user does not have NetworkInformationPermission.

The following table lists examples of tasks involving the My.Computer.Network.IsAvailable property.

To See
Check whether a computer is connected to a network How to: Check Connection Status

Applies to

See also