import system.io

  • Thread starter Thread starter Sender
  • Start date Start date
S

Sender

Hello all:

I have two forms in the project: form1, form2. form1 reads a file. form2
write data to that file. On form1 outside any class I am writing:

Import system.io

Right now I have also to write this again in form2 also.

If I have to use the file class in every form (in case I have 10 forms) do I
need to import this in every form or there is a way so that i could be
imported onces and be used by all the forms.

Thanks in advance!
 
Sender said:
Hello all:

I have two forms in the project: form1, form2. form1 reads a file. form2
write data to that file. On form1 outside any class I am writing:

Import system.io

Right now I have also to write this again in form2 also.

If I have to use the file class in every form (in case I have 10 forms) do I
need to import this in every form or there is a way so that i could be
imported onces and be used by all the forms.

Thanks in advance!

Go to the project properties and select Imports. Type System.IO in the textbox
marked Imports, and then click the add button. This will add system.io to the
global imports, and you won't have to type it in each file :)

Tom Shelton
 
In your project properties (right click your project name in solution
explorer and click properties) there is a heading called "Imports" You can
put global imports in that list
 
Sender said:
I have two forms in the project: form1, form2. form1 reads a file. form2
write data to that file. On form1 outside any class I am writing:

Import system.io

Right now I have also to write this again in form2 also.

If I have to use the file class in every form (in case I have 10 forms) do I
need to import this in every form or there is a way so that i could be
imported onces and be used by all the forms.

Open the project's property window and add the namespace to the
"Imports" section ("General Properties").
 
Back
Top