johnedw Level: Sage
 Registered: 15-08-2004 Posts: 50
|
Re: what is the difference between file and stream ?
Ok, FileStream class is a base class for FILEIO operations
ok, this is a pretty low level class...
For example,
Dim f as New FileStream ("C:\t.vb",FileMode.OpenOrCreate)
ok, now, this class has a write function for example,
that takes in an array of bytes, an offset and
a count.
This might be a little harder to do direct writing of strings
for example.... well anyway, it is defenitly a usable class but
the StreamWriter class however is a helper class(an even
higher level implementation)
So you could do...
Dim WriterFriendly as new StreamWriter(f) ' f would be the earlier filestream
WriterFriendly.Write("Hello")
WriterFriendly.Close
Hope this helps!
____________________________
Today is a new day, in
a world OF CODE!
|