ndowText(temp);
if (temp.GetLength()==0)
{
MessageBox("请选择网络接口!");
return;
}
NameToIndex.Lookup(temp,index);
CString oid;
oid="1.3.6.1.4.1.9.9.84.1.2.1.1.4."+index+".1";
m_snmp.clear();
m_snmp.GetTree(ip,community,oid);
Mac mac;
for(int i=0;i<m_snmp.GetCount();i++)
{
mac.x=atoi(m_snmp.GetValue(i));
mac.y=0;
temp=m_snmp.GetOid(i);
int n=temp.GetLength()-oid.GetLength()-1;
temp=temp.Right(n);
mac.str=stoh(temp);
ArrayMac.Add(mac);
}
int count=ArrayMac.GetSize();
m_snmp.clear();
oid="1.3.6.1.4.1.9.9.84.1.2.1.1.4."+index+".2";
m_snmp.GetTree(ip,community,oid);
for(i=0;i<m_snmp.GetCount();i++)
{
temp=m_snmp.GetOid(i);
int n=temp.GetLength()-oid.GetLength()-1;
temp=temp.Right(n);
temp=stoh(temp);
for (int j=0;j<count;j++)
{
if (temp==ArrayMac[j].str)
{
ArrayMac[j].y=atoi(m_snmp.GetValue(i));
break;
}
}
if (j==count)
{
mac.x=0;
mac.y=atoi(m_snmp.GetValue(i));
mac.str=temp;
ArrayMac.Add(mac);
}
}
CString ipStr;
pChart->Init();
for (i=0;i<ArrayMac.GetSize();i++)
{
ipStr="*.*.*.*";
if (MacToIp.IsEmpty()==0)
MacToIp.Lookup(ArrayMac[i].str,ipStr);
pChart->Append(ArrayMac[i].x,ArrayMac[i].y,ArrayMac[i].str,ipStr);
}
pChart->WorkPercent();
ArrayMac.RemoveAll();
CString txt="";
txt
上一篇:
MRYZYQX.pas
下一篇:
计算机仿真论文1