![]() |
import namespace
I created a streamreader:
:
Dim sOut As System.IO.StreamReaderBut the code I got off a web-page was: :
Dim sOut as streamreaderI know this is a basic question but I haven’t quite got my head around OOP. I’m guessing that the second lot of code would have had the namespace system.IO imported thus visual studios knows where to look for streamreader. My question is how would I use the import or what ever is required to get the second lot of code to work in a “public class form1" button.click procedure without having pre-pend the system.IO :
Public Class Form1I hope this makes sense. If it doesn’t then I will try to clarify to the best of my ability's within my limited programming vocabulary. hush |
You say at the top of the class or module
:
Imports System.IOIt will then be avaliable in any classes or modules that are in that file. I think thats about right. I have not done much VB.net :) |
Thanks RS
i was trying all sorts as i like to figure this stuff out myself, i even tried that without the 's' on the end of imports. i won't be forgeting that in a while. is it the same for c#? |
C# uses the keyword using, but the concept is the same.
e.g. :
|
| All times are GMT -5. The time now is 12:21 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC