This snippet will check if your computer is currently logged onto the internet in VB.NET. This is especially useful if you are using winsock
Module CheckNetwork
Sub main()
If My.Computer.Network.IsAvailable = True Then
System.Console.WriteLine("Computer is connected.")
Else
System.Console.WriteLine("Computer is not connected.")
End If
System.Console.ReadLine()
End Sub
End Module
The imports keyword is only used to create a shorthand notation for ease of use of the underlying namespace classes. When converted to MSIL the hardcoded IL written is actually System.Console.WriteLine ...
You are actually "importing" the functionality of an assembly when you add it to your project reference's file. P.S you can only use Imports when an external assembly is referenced.