Importing system classes
-
Hi, I want to use the class System.io and wonder where I put this class in my code. I put the imports system.io at the assemblyinfo.vb but no success in a form when I try and get some info e.g. my.computer.name or my.application.assemblyinfo.companyname. The squickally line appears below my. What simple thing am I doing wrong?
-
Hi, I want to use the class System.io and wonder where I put this class in my code. I put the imports system.io at the assemblyinfo.vb but no success in a form when I try and get some info e.g. my.computer.name or my.application.assemblyinfo.companyname. The squickally line appears below my. What simple thing am I doing wrong?
directred wrote:
I want to use the class System.io
That is a namespace, not a class.
directred wrote:
I put the imports system.io at the assemblyinfo.vb
Don't. It won't do anything for you there.
directred wrote:
What simple thing am I doing wrong?
Put the
Imports System.IO
at the top of each file that needs to use classes in that namespace. Alternatively, you can use the fully qualified name for each class. e.g.System.IO.FileStream
*** Developer Day 4 in Reading, England on 2nd December 2006 - Registration Now Open *** Upcoming Scottish Developers events: * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog | Photos
-
directred wrote:
I want to use the class System.io
That is a namespace, not a class.
directred wrote:
I put the imports system.io at the assemblyinfo.vb
Don't. It won't do anything for you there.
directred wrote:
What simple thing am I doing wrong?
Put the
Imports System.IO
at the top of each file that needs to use classes in that namespace. Alternatively, you can use the fully qualified name for each class. e.g.System.IO.FileStream
*** Developer Day 4 in Reading, England on 2nd December 2006 - Registration Now Open *** Upcoming Scottish Developers events: * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog | Photos
-
Example: Imports System.IO Public Class FileSystem Function FileExists(Byval sFile as String) as Boolean If File.Exists(sFile) Then Return True Else Return False End If End Function End Class SMC
You might prefer to reply to the original poster rather than me. It wasn't me that was looking for help.
*** Developer Day 4 in Reading, England on 2nd December 2006 - Registration Now Open *** Upcoming Scottish Developers events: * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog | Photos