May 2010
Intermediate to advanced
1272 pages
61h 18m
English
As we saw before, namespaces can expose objects that expose members. Moreover, namespaces can expose nested namespaces, exposing objects and so on. You often need to access members of objects exposed by nested namespaces. To avoid the need of typing the entire name of long (or nested) namespaces and writing long lines of code, the Visual Basic language offers the Imports directive. For example, consider the following lines of code that open a file on disk:

The FileStream class is exposed by the IO namespace that is exposed by the System namespace. You could place the following directive at the beginning of the code:
Imports ...
Read now
Unlock full access