SnmpGetLargeTable.java.txt
上传用户:aonuowh
上传日期:2021-05-23
资源大小:35390k
文件大小:1k
源码类别:

SNMP编程

开发平台:

C/C++

  1. /* $Id: SnmpGetLargeTable.java,v 1.1 2002/06/15 14:40:08 ram Exp $ */
  2. /* SnmpGetLargeTable.java
  3.  * Copyright (c) 1996-2003 AdventNet, Inc. All Rights Reserved.
  4.  * Please read the associated COPYRIGHTS file for more details.
  5.  */
  6. import javax.swing. *;
  7. import java.awt.event. *;
  8. import com.adventnet.snmp.ui. *;
  9. public class SnmpGetLargeTable  {
  10.     public static void main (String args[]) {
  11.   
  12.      JFrame frame = new JFrame ();
  13.      frame.addWindowListener (new WindowAdapter ()
  14.              {
  15.              public void windowClosing (WindowEvent evt)
  16.              {
  17.              System.exit (0);
  18.              }
  19.              }
  20.      );
  21.     frame.setSize (615, 400);
  22.     frame.setTitle (" Tutorial Example for retreiving SNMP Table using SnmpTablePanel");
  23.     
  24.         
  25.     SnmpTablePanel tablepanel = new SnmpTablePanel ();
  26.     tablepanel.setTargetHost("localhost");
  27.     tablepanel.setCommunity("public");
  28.         try {
  29.             tablepanel.loadMibs("RFC1213-MIB");
  30.             tablepanel.setTableOID ("ifTable");
  31.         } catch (Exception ex) {
  32.             System.err.println("Error: "+ex);
  33.         }
  34.         
  35. frame. getContentPane().add(tablepanel);
  36. frame.setVisible(true);
  37.   }
  38.     
  39. }