예제 #1
0
 private void DrawRectangle()
 {
     SnrViewer.NetworkEquipment ne = new SnrViewer.NetworkEquipment();
     ne.Ip = "192.168.0.33";
     ne.Community = "stvtelco";
     SnrViewer.SnmpSweep snmpsw = new SnrViewer.SnmpSweep(ne, new MyCallBack(this.OnResponse));
     sweep = new Thread(
         new ThreadStart(
                 snmpsw.getInterfacesAsync
             )
         );
     sweep.Start();
 }
예제 #2
0
 protected void runQuery()
 {
     try {
     SnrViewer.NetworkEquipment ne = new SnrViewer.NetworkEquipment();
     ne.Ip = "192.168.0.33";
     ne.Community = "stvtelco";
     SnrViewer.SnmpSweep ss = new SnrViewer.SnmpSweep(ne);
     ne = ss.getInterfaces();
     if (ne.TotalInterfaces > 0 ) {
         foreach (KeyValuePair<string, ArrayList> pair in ne.InterfaceTypes) {
             Console.WriteLine(">>" + pair.Key);
             if (pair.Value != null ) {
                 foreach (SnrViewer.NetworkInterface i in pair.Value) {
                     if (i != null )
                         Console.WriteLine("\t " + i.Descr + " -- " + i.Id);
                 }
             }
         }
     } else
         Console.WriteLine("No interfaces");
     }catch (Exception e ) {
         Console.WriteLine(e.ToString());
     }
 }