Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Network::IsAvailable Property

 

Indicates whether a computer is connected to a network.

Namespace:   Microsoft.VisualBasic.Devices
Assembly:  Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)

public:
property bool IsAvailable {
	bool get();
}

Property Value

Type: System::Boolean

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

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 in Visual Basic

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

FileIOPermission

Controls the ability to access files and folders. Associated enumeration: Unrestricted.

WebPermission

Controls rights to access HTTP Internet resources. Associated enumeration: Unrestricted.

.NET Framework
Available since 2.0
Return to top
Show:
© 2017 Microsoft