views:

46

answers:

1

Hi i am new to the system programming...i want to read information from fat table like total sector,total physical drive,containing logical drive types and as well containing files in the drives(like their file size,when accessed)with all information of files..and then display of these files with respect of their hierarchy at GUI.

this is easy if we use System.IO namespace.but it is restricted for me.so please help

A: 

You'll have to DllImport the Kernel32.dll to do this.

internal extern static int ReadFile(SafeFileHandle handle, byte[] bytes,
int numBytesToRead, out int numBytesRead, IntPtr overlapped_MustBeZero);

ReadFile(handleValue, buf, size, out read, IntPtr.Zero);

As an example above of reading a file.

Head over to pinvoke for me details

Sres