⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mfnettraffic.h

📁 很好的网络流量统计源代码。 使用曲线图进行实时统计。 采集数据主要在类 MFNetTraffic 中实现
💻 H
字号:
/*******************************************

	MFTrafficButton

	Version:	1.0
	Date:		31.10.2001
	Author:		Michael Fatzi
	Mail:		Michael_Fatzi@hotmail.com
	Copyright 1996-1997, Keith Rule

	You may freely use or modify this code provided this
	Copyright is included in all derived versions.
	
	History: 10.2001 Startup

	Handy little button control to display current 
	nettraffic as graph in a button.

********************************************/

// MFNetTraffic.h: interface for the MFNetTraffic class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_MFNETTRAFFIC_H__9CA9C41F_F929_4F26_BD1F_2B5827090494__INCLUDED_)
#define AFX_MFNETTRAFFIC_H__9CA9C41F_F929_4F26_BD1F_2B5827090494__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <afxtempl.h>


class MFNetTraffic  
{
public:
	enum TrafficType 
	{
		AllTraffic		= 388,
		IncomingTraffic	= 264,
		OutGoingTraffic	= 506
	};

	void SetTrafficType(int trafficType);
	DWORD	GetInterfaceTotalTraffic(int index);
	BOOL	GetNetworkInterfaceName(CString *InterfaceName, int index);
	int		GetNetworkInterfacesCount();
	double	GetTraffic(int interfaceNumber);

	DWORD	GetInterfaceBandwidth(int index);
	MFNetTraffic();
	virtual ~MFNetTraffic();
private:
	BOOL		GetInterfaces();
	double		lasttraffic;
	CStringList Interfaces;
	CList < DWORD, DWORD &>		Bandwidths;
	CList < DWORD, DWORD &>		TotalTraffics;
	int CurrentInterface;
	int CurrentTrafficType;
};

#endif // !defined(AFX_MFNETTRAFFIC_H__9CA9C41F_F929_4F26_BD1F_2B5827090494__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -