如何检查我的应用程序从磁盘写入和读取了多少字节? [英] How to check how many bytes my application wrote and read from Disk?

查看:55
本文介绍了如何检查我的应用程序从磁盘写入和读取了多少字节?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道我是否没有使用正确的词在网上搜索,但是我没有找到解决方案来观察我的应用程序已经在磁盘上读写了多少.

I don't know if I didn't use the right words to search on web but I didn't find the solution to watch how much my application already read and wrote on disk.

有人可以帮助我吗?

tks

如果有人需要功能符号.

If some one need the function sign.

type
  _IO_COUNTERS = record
    ReadOperationCount : LONGLONG;
    WriteOperationCount : LONGLONG;
    OtherOperationCount : LONGLONG;
    ReadTransferCount : LONGLONG;
    WriteTransferCount : LONGLONG;
    OtherTransferCount : LONGLONG;
  end;
  TIoCounters = _IO_COUNTERS;

  function GetProcessIoCounters(hProcess: THandle; var lpIoCounters: TIoCounters): BOOL; stdcall external kernel32;

推荐答案

如果您希望以编程方式获取此信息,则可以使用 Win32_Process 类并检查这些属性(WriteOperationCount,WriteTransferCount,ReadTransferCount,ReadOperationCount).

if you want get this info programmatically you can use the GetProcessIoCounters function. Another alternative is using the WMI , see the Win32_Process class and check these properties (WriteOperationCount, WriteTransferCount, ReadTransferCount, ReadOperationCount).

这篇关于如何检查我的应用程序从磁盘写入和读取了多少字节?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆