473,466 Members | 1,388 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

import system.io

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!
Nov 20 '05 #1
3 8766

"Sender" <us**@domain.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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
Nov 20 '05 #2
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" <us**@domain.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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!

Nov 20 '05 #3
"Sender" <us**@domain.com> scripsit:
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").

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Steve Jorgensen | last post by:
I'm restarting this thread with a different focus. The project I'm working on now id coming along and will be made to work, and it's too late to start over with a new strategy. Still, I'm not...
1
by: D. Shane Fowlkes | last post by:
Tw part question: 1 - Is it <% @Import Namespace..... or <%@ Import Namespace... ? I'm seeing it both ways in a book (but I think one is a typo. My pages don't seem to care which it is. Or do...
1
by: Jena | last post by:
Hi all, i've an example where in the page.aspx there are two strings like these: <% @Import Namespace="System.Data" %> <% @Import Namespace="System.Data.OleDb" %> in the page_load sub, using...
1
by: | last post by:
Hi all I can't import some namespace with non-codebehind page.. for example. <%@ Import Namespace="System.ServiceProcess"%> In code-behind,we have to reference System.ServiceProcess.dll...
4
by: Bruce W. Roeser | last post by:
All, I'm reading a book by Charles Petzold (Programming VS.Net). Pretty good content but am confused about the difference. From the text: ...
2
by: Siu | last post by:
Hi, I use the following code to export and import a file Excel from resp. into a Web page with the following code: //EXPORT Response.Clear(); Response.Buffer = true; Response.ContentType =...
3
by: Chris | last post by:
Hi, 1) In file test.aspx, i put: <%@ Page Language="VB" AutoEventWireup="false" CodeFile="test.aspx.vb" Inherits="test" %> <%@ import namespace="System.Data"%> <%@ import...
1
by: Eric Hanchrow | last post by:
(This is with Python 2.5.2, on Ubuntu Hardy, if it matters.) This seems so basic that I'm surprised that I didn't find anything about it in the FAQ. (Yes, I am fairly new to Python.) Here are...
3
by: J. Cliff Dyer | last post by:
On Thu, 2008-05-08 at 12:00 -0700, Eric Hanchrow wrote: It's the same reason as this: 5 5 6 5 Python "variables" are just names that point at objects. When you
9
by: a | last post by:
Dear friends I want import data from CSV file to mdb file How can I do that in vb.net?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.