怎样得到网络的浏览数据(300分)

  • 主题发起人 李亚平
  • 开始时间

李亚平

Unregistered / Unconfirmed
GUEST, unregistred user!
怎样能得到当前网络的即时流量,包括拨号适配器和网卡,请问怎样用程序实现.DELPHI.有无控件.
 
用IPman,或snmp试一试
 
李亚平: 放弃吧, 300分也不会有结果的. 顶多给你一个IPMAN什么的.
 
我想找找Vpacket.vxd的文档吧.
里面封装的API是很有用的.
用不用我mail a copy?
 
我觉得肯定有相应的API,查一下系统监视器用的DLL吧
 
没有delphi做不到的,你的问题太大,不会。

---瞎说
 
xixi, 太简单了, 你到系统注册表的HKEY_DYN_DATA下看看, 里面的好东东
可多了, 包括流量, CPU占用率等等. 我用过很多次了!!
 
to Jimchael Tsee:
HKEY_DYN_DATA中的数据是随时更新的吗?
 
HKEY——DYN——DATA 是更新的!!
 
用性能监视API,可以监视系统的决大部分资源的
使用情况,包括CPU、MEMORY、NET、DISK等等。
我刚DOWN了两个关于性能监视API的控件,还没
来得及实验...
 
to lhz:

什么控件, 能否分享一份你的快乐?
 
To lhz:
能不能给yysun一份,储备在控件库里.
 
chenke或者其他大虾寄我一份snmp好吗?
 
在注册表中,HKEY_DYN_DATA/PerfStats下的StartStat和StopStat
相当于是Trigger. 你通过“看一眼”(即读一下)StartStat中的值
开始记录,(StopStat既是停止记录)
 
我已经传给yysun了.我是在
<a href="http://www.torry.ru/">Torry's Delphi Pages</a>下载的.
 
不知道那位有与VPacket.Vxd等价的Vpacket.sys for NT, 我在Ipman的网站上见到
有这个文件介绍, 但是找不到文件下载
 
谁能再写详细一些,最好有源程序,我立即给分
 
如果您的e-mail够大,我给您那两个性能监视的控件,
都有源码的.
 
下面是我写的得到CPU占用率的动态链接库, 用的是系统注册表的方法,
要得到网络数据是一样的, 你可以读一下HKEY_DYN_DATA中相应的键值.

library Cpuusg;

{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }

uses
SysUtils,
Windows,
Registry,
Classes;

function _Cpu: integer;
var
Reg: TRegistry;
usage: integer;
begin
Reg := TRegistry.Create;
Reg.RootKey:= HKEY_DYN_DATA;
Reg.OpenKey('PerfStats/StatData', false);
Reg.ReadBinaryData('KERNEL/CPUUsage', usage, sizeof(usage));
Reg.CloseKey;
Reg.Free;
Result := usage;
end;

procedure _BeginMonite;
var
Reg: TRegistry;
usage: integer;
begin
Reg := TRegistry.Create;
Reg.RootKey:= HKEY_DYN_DATA;
Reg.OpenKey('PerfStats/StartStat', false);
Reg.ReadBinaryData('KERNEL/CPUUsage', usage, sizeof(usage));
Reg.CloseKey;
Reg.Free;
end;

procedure _EndMonite;
var
Reg: TRegistry;
usage: integer;
begin
Reg := TRegistry.Create;
Reg.RootKey:= HKEY_DYN_DATA;
Reg.OpenKey('PerfStats/StopStat', false);
Reg.ReadBinaryData('KERNEL/CPUUsage', usage, sizeof(usage));
Reg.CloseKey;
Reg.Free;
end;

exports
_Cpu index 1,
_BeginMonite index 2,
_EndMonite index 3;

begin
end.

 
多谢各位大虾,不过你们讨论了一些文件,我这里可能已经拥有,
应为我从网上作了"http://www.torry.ru/和深度历险的映像大约1G,
希望大家能够在讨论时提供文件名.

Jimchael Tsee:
多谢您给出院码,但是我在作实验时发现
'PerfStats/StartStat'内的值好像倍锁定,读不出来.

LHZ:能说说控件名称码

我快要给分了!
 

Similar threads

S
回复
0
查看
1K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
975
SUNSTONE的Delphi笔记
S
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
顶部