Version: 4.4.2.3
Create custom SNMP Manager, Trap and Agent applications for monitoring and controlling network devices. 

Windows Forms MIB Walk Code Example

The following example demonstrates an SNMP manager in a Windows Forms environment. The manager "walks" an agent's mib (retrieves all variables under a specified OID). In this example, a Treeview control is populated with an agent's "system" group variables.

< Back to all samples for PowerSNMP for .NET

private void button1_Click(object sender, EventArgs e)
{
    //Perform mib walk on a worker thread
    manager1.Start(walkMib, manager1.Mib.GetByNodeName(NodeName.system).Oid);
}

private void walkMib(Dart.Snmp.ManagerSlave slave, object state)
{
    //The state contains the OID to walk (in this case, the system group)
    string oid = state.ToString();

    //Walk the mib from the specified root oid
    VariableList variables = slave.Walk(oid, myAgentAddress.HostNameOrAddress);

    //Marshal variables returned to the UI thread using the Walk event
    manager1.Marshal(oid, variables, ""null);
}

private void manager1_Walk(object sender, WalkEventArgs e)
{
    //Populate a treeview control with the returned variables
    e.Variables.Populate(tvwVariables, e.Oid, manager1.Mib);
}