Esempio n. 1
0
 public void DNATDB_Gridbinding()
 {
     try
     {
         conn.Open();
         string sqlstr = "select * from dnat where fwmac='" + StaticGlobal.firewallmac + "'";
         StaticGlobal.FireWalldevices[StaticGlobal.firewallindex].getDNATRule_list().Clear();
         StaticGlobal.DNAToldrules.Clear();
         MySqlCommand    cm = new MySqlCommand(sqlstr, conn);
         MySqlDataReader dr = cm.ExecuteReader();
         //绑定
         while (dr.Read())
         {
             DNATRuleDataTable datatable = new DNATRuleDataTable();
             datatable.origin_dstIP = dr[1].ToString();
             datatable.origin_dport = dr[2].ToString();
             datatable.map_IP       = dr[3].ToString();
             datatable.map_port     = dr[4].ToString();
             StaticGlobal.FireWalldevices[StaticGlobal.firewallindex].getDNATRule_list().Add(datatable);
             StaticGlobal.DNAToldrules.Add(datatable);
         }
         dr.Close();
     }
     catch (Exception e)
     {
         Console.WriteLine("exceptionInfo {0}", e);
     }
     finally
     {
         conn.Close();
     }
 }
Esempio n. 2
0
 public void addDNATRule(DNATRuleDataTable fwrdt)
 {
     DNATRuleLists.Add(fwrdt);
 }