411 REFERENCE · Wikibooks
Visual Basic .NET/Namespaces
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
Namespaces
Namespaces allows to separate the different imported programs, especially when they are long like libraries.
In a module, simply enter (without any module name):
Namespace Packet1
Class ExternalClass
Public Name As String = "Default"
End Class
End Namespace
To import them after, use Imports.
For example from another module of the project ConsoleApplication1:
Imports ConsoleApplication1.Packet1
Module Module1
Sub Main()
Dim LocalName = New ExternalClass
Console.WriteLine(LocalName.Name)
Console.ReadLine() ' Displays "Default"
End Sub
End Module
By commenting the importation line, the following error appears: ExternalClass Type undefined.
References
http://msdn.microsoft.com/en-us//library/zt9tafza.aspx
fr:Visual Basic .NET/Namespaces