简体   繁体   English

在不使用C#中的System.IO的情况下对Fat表进行读/写操作

[英]Read/Write operation on Fat table with out using System.IO in C#

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. 嗨,我是系统编程的新手...我想从胖表中读取信息,例如总扇区,总物理驱动器,包含逻辑驱动器类型以及驱动器中的文件(如文件大小,在访问时),所有文件的信息。然后在GUI上显示这些文件的层次结构。

this is easy if we use System.IO namespace.but it is restricted for me.so please help 如果我们使用System.IO名称空间,这很容易。但是它对我来说是受限制的。所以请帮助

You'll have to DllImport the Kernel32.dll to do this. 您必须DllImport Kernel32.dll才能执行此操作。

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 头以上的PInvoke我的详细信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM