|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
problem in declaring streamwriter objectI have already imported system.io. Reader object is working fine: Dim sr As
New StreamReader(fstream). Writer object Dim sw As New StreamWriter(fstream) object shows blue under line with type expected on hovering the mouse. However, when I create object like this Dim sw As New IO.StreamWriter(fstream) it works fine. Why this is happening! Thank you waiting for reply Karan "Karan" <karan***@hotmail.com> schrieb User "go to definition" (from the context menu) on the word "Streamwriter". > I have already imported system.io. Reader object is working fine: > Dim sr As New StreamReader(fstream). Writer object > Dim sw As New StreamWriter(fstream) object shows blue under line > with type expected on hovering the mouse. However, when I create > object like this Dim sw As New IO.StreamWriter(fstream) it works > fine. > > Why this is happening! What happens? Armin The classes under the IO namespace are not in the global namespace by
default. To access them you have to qualify them with the IO namespace before them. If you want to include them in the global namespace make this the first line of your module Imports System.IO This should be before everything else in your code. Regards Cyril Gupta Ooops... I jumped the gun. On reading the text again I realized you have
already imported IO Ooops again |
|||||||||||||||||||||||