Work with excel or other ole automation object

  • Thread starter Thread starter Peter Jausovec
  • Start date Start date
hi,
as i know, stream classes like , filereader etc are readers that use buffer.
is there any possibility to directly read files from hdd (i need to know
how fast file is read so no buffers should exist)
i mean it is like C
read byte byte from hdd , not from buffered stream
thanks in advance
Erdem Kemer
 
Erdem,

The FileStream class does not use a buffer, rather, it calls the
CreateFile API and then ReadFile. Now, the OS may be doing some buffering,
in which case, you would have to ask for direct file access. Which API you
would use for that though, I do not know. However, once you know which API
to call, you can easily call it through the P/Invoke layer.

Hope this helps.
 
Hi,

I'd like to know how to work with excel using C#. I known how to do it in
Delphi but I new in C#. I just want a small exemple. And if anyone knows if
there are diferrence working with excel por pocket pc, let me known. I just
want to put some values and format some cells and columns...
Any site or book that I should read?

TIA,
Heriberto
 
You can't read byte by byte from a HDD, even a device driver can't do it, a
disk will allways read at least one cluster and cache the data in the HDD
cache.
The OS Filesystem will also cache the data read from the HDD driver, so
everything you do in top of it can't prevent caching.
The only thing you can do is pretend you are reading byte per byte (from
C/C++ or any other language) using FileStream.ReadByte in .NET, but
basically you are only moving a byte at a time from the internal buffer of
the stream to your application defined byte location (heap, stack,
whatever).

Willy.
 
Back
Top