示例#1
0
 private void textBox1_Enter(object sender, EventArgs e)
 {
     if (this.Itemidx == 3 || FormID == 1)
     {
         label1.Text = StringsDictionary.KeyValue("Form1_textBox2_Enter", this.culture);
     }
 }
 public void SwitchLanguage(CultureInfo culture)
 {
     this.culture = culture;
     this.Text    = StringsDictionary.KeyValue("ListDNSRev_Form.Text", this.culture);
     //
     this.copyToolStripMenuItem.Text  = StringsDictionary.KeyValue("ListDNSRev_copyToolStripMenuItem.Text", this.culture);
     this.FirstPage.Text              = StringsDictionary.KeyValue("ListDNSRev_FirstPage.Text", this.culture);
     this.fontsToolStripMenuItem.Text = StringsDictionary.KeyValue("ListDNSRev_fontsToolStripMenuItem.Text", this.culture);
     this.Goto.Text   = StringsDictionary.KeyValue("ListDNSRev_Goto.Text", this.culture);
     this.label1.Text = StringsDictionary.KeyValue("ListDNSRev_label1.Text", this.culture);
     this.label3.Text = StringsDictionary.KeyValue("ListDNSRev_label3.Text", this.culture);
     this.label4.Text = StringsDictionary.KeyValue("ListDNSRev_label4.Text", this.culture);
     this.label7.Text = StringsDictionary.KeyValue("ListDNSRev_label7.Text", this.culture);
     this.label8.Text = StringsDictionary.KeyValue("ListDNSRev_label8.Text", this.culture);
     this.savetoolStripMenuItem1.Text     = StringsDictionary.KeyValue("ListDNSRev_savetoolStripMenuItem1.Text", this.culture);
     this.selectAllToolStripMenuItem.Text = StringsDictionary.KeyValue("ListDNSRev_selectAllToolStripMenuItem.Text", this.culture);
     if (this.textBox3.Text.Length > 3)
     {
         this.textBox3.Text = StringsDictionary.KeyValue("ListDNSRev_textBox3.Text", this.culture);
     }
     //
     this.toolTip1.SetToolTip(this.FirstPage, StringsDictionary.KeyValue("ListDNSRev_FirstPage.ToolTip", this.culture));
     this.toolTip1.SetToolTip(this.LastPage, StringsDictionary.KeyValue("ListDNSRev_LastPage.ToolTip", this.culture));
     this.toolTip1.SetToolTip(this.textBox3, StringsDictionary.KeyValue("ListDNSRev_textBox3.Tooltip", this.culture));
     //
     this.UpdateCount();
     this.ChangeUILanguage.Invoke(this.culture);
 }
示例#3
0
        public void SwitchLanguage(CultureInfo culture)
        {
            this.culture = culture;

            this.Text        = StringsDictionary.KeyValue("SaveAsText_Form", this.culture);
            this.label4.Text = StringsDictionary.KeyValue("SaveAs_label4.Text", this.culture);
            //
            this.cancelButton.Text  = StringsDictionary.KeyValue("SaveAs_cancelButton.Text", this.culture);
            this.columnHeader1.Text = StringsDictionary.KeyValue("SaveAs_columnHeader1.Text", this.culture);
            this.columnHeader2.Text = StringsDictionary.KeyValue("SaveAs_columnHeader2.Text", this.culture);
            this.exitButton.Text    = StringsDictionary.KeyValue("SaveAs_exitButton.Text", this.culture);
            this.label10.Text       = StringsDictionary.KeyValue("SaveAs_label10.Text", this.culture);
            this.label11.Text       = StringsDictionary.KeyValue("SaveAs_label11.Text", this.culture);
            this.label12.Text       = StringsDictionary.KeyValue("SaveAs_label12.Text", this.culture);
            this.label2.Text        = StringsDictionary.KeyValue("SaveAs_label2.Text", this.culture);
            this.label3.Text        = StringsDictionary.KeyValue("SaveAs_label3.Text", this.culture);
            this.label4.Text        = StringsDictionary.KeyValue("SaveAs_label4.Text", this.culture);
            this.label5.Text        = StringsDictionary.KeyValue("SaveAs_label5.Text", this.culture);
            this.label6.Text        = StringsDictionary.KeyValue("SaveAs_label6.Text", this.culture);
            this.SaveAs.Text        = StringsDictionary.KeyValue("SaveAs_SaveAs.Text", this.culture);
            this.textBox1.Text      = StringsDictionary.KeyValue("SaveAs_textBox1.Text", this.culture);
            this.textBox2.Text      = StringsDictionary.KeyValue("SaveAs_textBox2.Text", this.culture);
            this.checkBox1.Text     = StringsDictionary.KeyValue("SaveAs_checkBox1.Text", this.culture);
            //
            this.toolTip1.SetToolTip(this.label8, StringsDictionary.KeyValue("SaveAs_label8.ToolTip", this.culture));
            this.toolTip1.SetToolTip(this.label9, StringsDictionary.KeyValue("SaveAs_label9.ToolTip", this.culture));
            this.toolTip1.SetToolTip(this.textBox4, StringsDictionary.KeyValue("SaveAs_textBox4.ToolTip", this.culture));
        }
 private void UpdateCount()
 {
     if (this.currentMode == "v6")
     {
         if (StartEnd.subnetslash % 4 == 0)
         {
             this.textBox4.Text = "[" + this.listBox1.Items.Count.ToString()
                                  + StringsDictionary.KeyValue("ListDNSRev_UpdateCount_textBox4", this.culture);
         }
         else
         {
             int nonnibble = (1 << (4 - StartEnd.subnetslash % 4));
             this.textBox4.Text = "[" + (this.listBox1.Items.Count / nonnibble).ToString()
                                  + StringsDictionary.KeyValue("ListDNSRev_UpdateCount_textBox4", this.culture);
         }
     }
     else // v4
     {
         if (StartEnd.subnetslash % 8 == 0)
         {
             this.textBox4.Text = "[" + this.listBox1.Items.Count.ToString()
                                  + StringsDictionary.KeyValue("ListDNSRev_UpdateCount_textBox4", this.culture);
         }
         else
         {
             int nonnibble = (1 << (8 - StartEnd.subnetslash % 8));
             this.textBox4.Text = "[" + (this.listBox1.Items.Count / nonnibble).ToString()
                                  + StringsDictionary.KeyValue("ListDNSRev_UpdateCount_textBox4", this.culture);
         }
     }
 }
示例#5
0
 void bgw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     this.progressBar1.Hide();
     this.textBox2.Text = StringsDictionary.KeyValue("whois_bgw_RunWorkerCompleted_textBox2.Text", this.culture)
                          + this.textBox1.Text + "\r\n******\r\n" + whois_response.ToString();
     this.buttonWhoisQuery.Enabled = true;
 }
示例#6
0
        private void ExportToFile_FormClosing(object sender, FormClosingEventArgs e)
        {
            IPv6SubnettingTool.Form1.RemoveForm(this.GetHashCode());

            if (this.backgroundWorker1.IsBusy || this.backgroundWorker2.IsBusy)
            {
                this.backgroundWorker1.CancelAsync();
                this.backgroundWorker2.CancelAsync();

                MessageBox.Show(StringsDictionary.KeyValue("SaveAs_ExportToFile_FormClosing_Msg", this.culture)
                                + saveState.percentage.ToString() + "% )",
                                StringsDictionary.KeyValue("SaveAs_ExportToFile_FormClosing_Msg_head", this.culture),
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Exclamation,
                                MessageBoxDefaultButton.Button1);

                if (File.Exists(this.saveDialog.FileName))
                {
                    try
                    {
                        File.Delete(this.saveDialog.FileName);
                    }
                    catch (SystemException ioex)
                    {
                        MessageBox.Show(StringsDictionary.KeyValue("SaveAs_bgw_RunWorkerCompleted_error", this.culture)
                                        + ioex.Message,
                                        StringsDictionary.KeyValue("SaveAs_bgw_RunWorkerCompleted_head_file", this.culture),
                                        MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);

                        return;
                    }
                }
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            this.tmp_last = "";
            this.PreCalc();

            int r = this.MySQLquery(1);

            if (r > 0)
            {
                if (this.db_ItemCount > this.records_perpage)
                {
                    this.button2.Enabled = false;
                    this.button3.Enabled = true;
                    this.button4.Enabled = true;
                }
                else
                {
                    this.button2.Enabled = false;
                    this.button3.Enabled = false;
                    this.button4.Enabled = false;
                }
            }
            else
            {
                this.button2.Enabled = false;
                this.button3.Enabled = false;
                this.button4.Enabled = false;
            }
            this.label4.Text = "[" + this.page_records
                               + StringsDictionary.KeyValue("ListAssignedfromDBForm_label4.Text", this.culture);
        }
        private void textBox2_TextChanged(object sender, EventArgs e)
        {
            string skey = this.textBox2.Text.Trim();

            if (skey == "" || skey == null)
            {
                source1.RemoveFilter();

                this.toolStripStatusLabel1.Text = StringsDictionary.KeyValue("ServiceNamesPortNumbers_toolStripStatusLabel1.Text", this.culture)
                                                  + this.dataGridView1.RowCount.ToString();

                return;
            }
            this.textBox1.Clear();

            //string strFormat = "PortNumber LIKE '{0}%'"; // number Starts with
            string strFormat = "PortNumber = '{0}'";       // exact match

            if (this.checkBox1.Checked)
            {
                strFormat = "PortNumber LIKE '%{0}%'"; // including number
            }

            source1.Filter = string.Format(strFormat, skey);

            this.toolStripStatusLabel1.Text = StringsDictionary.KeyValue("ServiceNamesPortNumbers_toolStripStatusLabel1.Text", this.culture)
                                              + this.dataGridView1.RowCount.ToString();
        }
示例#9
0
 public void SwitchLanguage(CultureInfo culture)
 {
     this.culture       = culture;
     this.button13.Text = StringsDictionary.KeyValue("VKeyboard_button13", this.culture);
     this.button14.Text = StringsDictionary.KeyValue("VKeyboard_button14", this.culture);
     this.button21.Text = StringsDictionary.KeyValue("VKeyboard_button21", this.culture);
 }
示例#10
0
 void bgw2_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     if (this.backgroundWorker1.IsBusy == true)
     {
         this.label5.Text = StringsDictionary.KeyValue("SaveAs_bgw2_ProgressChanged_label5", this.culture)
                            + this.count.ToString();
     }
 }
        public Goto(Form callingForm, int idx, BigInteger max, int FormID, CultureInfo culture, string mode)
        {
            InitializeComponent();

            this.maxval      = max;
            this.Itemidx     = idx;
            this.FormID      = FormID;
            this.currentMode = mode;

            if (FormID == 1)
            {
                mainFormListSub  = callingForm as ListSubnetRange;
                this.label3.Text = this.textBox2.Text = " ";
            }
            else if (FormID == 0)
            {
                mainForm = callingForm as Form1;

                if (idx == 3)
                {
                    this.label3.Text = this.textBox2.Text = " ";
                }
                else
                {
                    this.textBox2.Text = maxval.ToString();
                }
            }

            this.culture = culture;
            this.SwitchLanguage(this.culture);

            if (idx == 1)
            {
                label1.Text = StringsDictionary.KeyValue("Goto_label1.Text1", this.culture);
            }
            else if (idx == 2)
            {
                label1.Text = StringsDictionary.KeyValue("Goto_label1.Text2", this.culture);
            }
            else if (idx == 3)
            {
                label1.Text = StringsDictionary.KeyValue("Goto_label1.Text3", this.culture);
            }
            else
            {
                label1.Text = "";
            }

            if (this.FormID == 0)
            {
                this.textBox1.Text = mainForm.GotoForm_PrevValue;
            }
            else if (this.FormID == 1)
            {
                this.textBox1.Text = mainFormListSub.GotoForm_PrevValue;
            }
        }
示例#12
0
        public ListAssignedfromDB(string prefix, string end, short parentpflen, short pflen, CheckState chks,
                                  OdbcConnection sqlcon, DBServerInfo servinfo, CultureInfo culture, string mode)
        {
            InitializeComponent();

            this.currentMode     = mode;
            this.parentpflen     = parentpflen;
            this.pflen           = pflen;
            this.chks            = chks;
            this.MySQLconnection = sqlcon;
            this.ServerInfo      = servinfo.ShallowCopy();
            this.culture         = culture;
            this.SwitchLanguage(culture);

            if (this.currentMode == "v6")
            {
                this.prefix = v6ST.CompressAddress(prefix.Split('/')[0]);
                this.end    = v6ST.CompressAddress(end.Split('/')[0]);

                this.toolStripStatusLabel1.Text = "Database: " + this.ServerInfo.DBname;
            }
            else // v4
            {
                this.prefix = prefix.Split('/')[0];
                this.end    = end.Split('/')[0];

                this.toolStripStatusLabel1.Text = "Database: " + this.ServerInfo.DBname_v4;
            }

            this.label2.ForeColor = Color.RoyalBlue;
            this.label2.Text      = prefix + " - " + "/" + pflen;

            this.groupBox1.Text = "/" + pflen
                                  + StringsDictionary.KeyValue("StatsUsageForm_groupBox2.Text", this.culture);

            if (this.MySQLconnection == null)
            {
                this.toolStripStatusLabel2.Text = "db=Down";
            }
            else
            {
                if (this.MySQLconnection.State == ConnectionState.Open)
                {
                    this.toolStripStatusLabel2.Text = "db=Up";
                }
                else if (this.MySQLconnection.State == ConnectionState.Closed)
                {
                    this.toolStripStatusLabel2.Text = "db=Down";
                }
            }

            this.PreCalc();
            this.FirstAndLastInDB();
            this.button1_Click(null, null);
            this.label4.Text = "[" + this.page_records
                               + StringsDictionary.KeyValue("ListAssignedfromDBForm_label4.Text", this.culture);
        }
示例#13
0
        public void SwitchLanguage(CultureInfo culture)
        {
            this.culture = culture;

            this.Text = StringsDictionary.KeyValue("whois_Form.Text", this.culture);
            //
            this.buttonWhoisQuery.Text = StringsDictionary.KeyValue("whois_buttonWhoisQuery.Text", this.culture);
            this.label1.Text           = StringsDictionary.KeyValue("whois_label1.Text", this.culture);
            this.label2.Text           = StringsDictionary.KeyValue("whois_label2.Text", this.culture);
        }
示例#14
0
        public void SwitchLanguage(CultureInfo culture)
        {
            this.culture = culture;
            this.Text    = StringsDictionary.KeyValue("PrefixSubLevelsForm.Text", this.culture);
            //
            this.label1.Text = StringsDictionary.KeyValue("PrefixSubLevelsForm_label1.Text", this.culture);
            this.label2.Text = StringsDictionary.KeyValue("PrefixSubLevelsForm_label2.Text", this.culture);
            this.dBInfoAboutPrefixToolStripMenuItem.Text = StringsDictionary.KeyValue("Form1_getPrefixInfoFromDB.Text", this.culture);

            this.ChangeUILanguage.Invoke(this.culture);
        }
示例#15
0
        public void SwitchLanguage(CultureInfo culture)
        {
            this.culture = culture;
            this.Text    = StringsDictionary.KeyValue("PrefixSubLevelsForm.Text", this.culture);
            //
            this.label1.Text = StringsDictionary.KeyValue("PrefixSubLevelsForm_label1.Text", this.culture);
            this.label2.Text = StringsDictionary.KeyValue("PrefixSubLevelsForm_label2.Text", this.culture);
            this.label3.Text = StringsDictionary.KeyValue("PrefixSubLevelsForm_recordlimit", this.culture);

            this.ChangeUILanguage.Invoke(this.culture);
        }
 public void SwitchLanguage(CultureInfo culture)
 {
     this.culture      = culture;
     this.Text         = StringsDictionary.KeyValue("CompressForm.Text", this.culture);
     this.label1.Text  = StringsDictionary.KeyValue("CompressForm_label1.Text", this.culture);
     this.label2.Text  = StringsDictionary.KeyValue("CompressForm_label2.Text", this.culture);
     this.label4.Text  = StringsDictionary.KeyValue("CompressForm_label4.Text", this.culture);
     this.button1.Text = StringsDictionary.KeyValue("CompressForm_button1.Text", this.culture);
     //
     this.ChangeUILanguage.Invoke(this.culture);
 }
示例#17
0
 public void SwitchLanguage(CultureInfo culture)
 {
     this.culture      = culture;
     this.Text         = StringsDictionary.KeyValue("UpdateServiceNamesPortNumbers_header.Text", this.culture);
     this.Text         = StringsDictionary.KeyValue("UpdateServiceNamesPortNumbers_header.Text", this.culture);
     this.label1.Text  = StringsDictionary.KeyValue("UpdateServiceNamesPortNumbers_label1.Text", this.culture);
     this.label2.Text  = StringsDictionary.KeyValue("UpdateServiceNamesPortNumbers_label2.Text", this.culture);
     this.label3.Text  = StringsDictionary.KeyValue("UpdateServiceNamesPortNumbers_label3.Text", this.culture);
     this.button1.Text = StringsDictionary.KeyValue("UpdateServiceNamesPortNumbers_button1.Text", this.culture);
     this.button2.Text = StringsDictionary.KeyValue("UpdateServiceNamesPortNumbers_button2.Text", this.culture);
 }
示例#18
0
        public void SwitchLanguage(CultureInfo culture)
        {
            this.culture = culture;

            this.Text         = StringsDictionary.KeyValue("Goto_Form.Text", this.culture);
            this.button1.Text = StringsDictionary.KeyValue("Goto_button1.Text", this.culture);

            if (this.Itemidx != 3)
            {
                this.label3.Text = StringsDictionary.KeyValue("Goto_label3.Text", this.culture);
            }
        }
 public void SwitchLanguage(CultureInfo culture)
 {
     this.culture      = culture;
     this.Text         = StringsDictionary.KeyValue("ListAssignedfromDBForm.Text", this.culture);
     this.button1.Text = StringsDictionary.KeyValue("ListAssignedfromDBForm_button1.Text", this.culture);
     this.selectalltoolStripMenuItem1.Text = StringsDictionary.KeyValue("ListAssignedfromDBForm_selectalltoolStripMenuItem1.Text", this.culture);
     this.copytoolStripMenuItem1.Text      = StringsDictionary.KeyValue("ListAssignedfromDBForm_copytoolStripMenuItem1.Text", this.culture);
     this.label1.Text    = StringsDictionary.KeyValue("ListSubnetRange_label4.Text", this.culture);
     this.groupBox1.Text = StringsDictionary.KeyValue("StatsUsageForm_groupBox2.Text", this.culture);
     this.label4.Text    = "[" + this.page_records
                           + StringsDictionary.KeyValue("ListAssignedfromDBForm_label4.Text", this.culture);
 }
示例#20
0
        public void SwitchLanguage(CultureInfo culture)
        {
            this.culture        = culture;
            this.Text           = StringsDictionary.KeyValue("StatsUsageForm.Text", this.culture);
            this.button1.Text   = StringsDictionary.KeyValue("StatsUsageForm_button1.Text", this.culture);
            this.label1.Text    = StringsDictionary.KeyValue("StatsUsageForm_label1.Text", this.culture);
            this.groupBox2.Text = "/" + pflen + " "
                                  + StringsDictionary.KeyValue("StatsUsageForm_groupBox2.Text", this.culture);
            //
            this.UpdateTextBox();

            this.ChangeUILanguage.Invoke(this.culture);
        }
        private void Calculate(string sin)
        {
            if (v6ST.IsAddressCorrect(textBox1.Text))
            {
                label3.Text = StringsDictionary.KeyValue("Form1_" + v6ST.errmsg, this.culture);
                string Resv6 = v6ST.FormalizeAddr(sin);

                // :-) full / expanded
                string veryformal = v6ST.Kolonlar(Resv6, CheckState.Checked);

                textBox2.Text = v6ST.CompressAddress(veryformal);

                string[] formal = veryformal.Split(':');
                textBox3.Clear();
                foreach (string s in formal)
                {
                    textBox3.Text +=
                        UInt16.Parse(s, System.Globalization.NumberStyles.AllowHexSpecifier).ToString("x")
                        + ":";
                }
                textBox3.Text = textBox3.Text.TrimEnd(':');

                seaddress.ResultIPAddr = seaddress.Start =
                    BigInteger.Parse("0" + Resv6, NumberStyles.AllowHexSpecifier);
                textBox4.Text = v6ST.PrintBin(seaddress, 128, CheckState.Checked).Replace(':', ' ');
                textBox5.Text = "0x" + Resv6;
                textBox6.Text = v6ST.DnsRev(seaddress.ResultIPAddr, 128, CheckState.Checked)[0];
                textBox7.Text = "ff02::1:ff" + formal[6][2] + formal[6][3] + ":" + formal[7];
                textBox8.Text = seaddress.ResultIPAddr.ToString();
                textBox9.Text = veryformal;
                string smac = v6ST.FormalizeAddr(textBox7.Text);
                smac = v6ST.Kolonlar(smac, CheckState.Checked);
                string[] asmac = smac.Split(':');
                textBox10.Text = "33:33:" + asmac[6][0] + asmac[6][1] + ":" + asmac[6][2] + asmac[6][3]
                                 + ":" + asmac[7][0] + asmac[7][1] + ":" + asmac[7][2] + asmac[7][3];
            }
            else
            {
                label3.Text = StringsDictionary.KeyValue("Form1_" + v6ST.errmsg, this.culture);
                textBox2.Clear();
                textBox3.Clear();
                textBox4.Clear();
                textBox5.Clear();
                textBox6.Clear();
                textBox7.Clear();
                textBox8.Clear();
                textBox9.Clear();
                textBox10.Clear();
            }
        }
        private void button4_Click(object sender, EventArgs e)
        {
            this.tmp_first = this.last_start;
            int r = this.MySQLquery(4);

            if (r > 0)
            {
                this.button2.Enabled = true;
                this.button3.Enabled = false;
                this.button4.Enabled = false;
            }
            this.label4.Text = "[" + this.page_records
                               + StringsDictionary.KeyValue("ListAssignedfromDBForm_label4.Text", this.culture);
        }
        public StatsUsage(string prefix, string end, short parentpflen, short pflen, CheckState chks,
                          OdbcConnection sqlcon, DBServerInfo servinfo, CultureInfo culture, string mode)
        {
            InitializeComponent();

            this.currentMode     = mode;
            this.prefix          = prefix;
            this.end             = end;
            this.pflen           = pflen;
            this.parentpflen     = parentpflen;
            this.chks            = chks;
            this.MySQLconnection = sqlcon;
            this.ServerInfo      = servinfo.ShallowCopy();
            this.culture         = culture;
            this.SwitchLanguage(culture);
            this.graph = this.CreateGraphics();

            this.label2.Text    = prefix + " - " + "/" + pflen;
            this.groupBox2.Text = "/" + pflen
                                  + StringsDictionary.KeyValue("StatsUsageForm_groupBox2.Text", this.culture);

            if (this.currentMode == "v6")
            {
                this.toolStripStatusLabel1.Text = "Database: " + this.ServerInfo.DBname;
            }
            else // v4
            {
                this.toolStripStatusLabel1.Text = "Database: " + this.ServerInfo.DBname_v4;
            }

            if (this.MySQLconnection == null)
            {
                this.toolStripStatusLabel2.Text = "db=Down";

                this.toolStripStatusLabel1.Text = "Database: null";
            }
            else
            {
                if (this.MySQLconnection.State == ConnectionState.Open)
                {
                    this.toolStripStatusLabel2.Text = "db=Up";
                }
                else if (this.MySQLconnection.State == ConnectionState.Closed)
                {
                    this.toolStripStatusLabel2.Text = "db=Down";
                }
            }

            this.Calculate();
        }
        public void SwitchLanguage(CultureInfo culture)
        {
            this.culture           = culture;
            this.label1.Text       = StringsDictionary.KeyValue("ASNumberPlainDotForm_label1.Text", this.culture);
            this.label2.Text       = StringsDictionary.KeyValue("ASNumberPlainDotForm_label2.Text", this.culture);
            this.label3.Text       = StringsDictionary.KeyValue("ASNumberPlainDotForm_label3.Text", this.culture);
            this.groupBox1.Text    = StringsDictionary.KeyValue("ASNumberPlainDotForm_grbox.Text", this.culture);
            this.radioButton1.Text = StringsDictionary.KeyValue("ASNumberPlainDotForm_rb1.Text", this.culture);
            this.radioButton2.Text = StringsDictionary.KeyValue("ASNumberPlainDotForm_rb2.Text", this.culture);
            this.button1.Text      = StringsDictionary.KeyValue("ASNumberPlainDotForm_button1.Text", this.culture);
            this.button2.Text      = StringsDictionary.KeyValue("ASNumberPlainDotForm_button2.Text", this.culture);

            this.ChangeUILanguage.Invoke(this.culture);
        }
示例#25
0
        public int MySQLquery()
        {
            if (this.MySQLconnection == null)
            {
                return(-1);
            }

            if (this.MySQLconnection.State == ConnectionState.Closed)
            {
                MessageBox.Show(StringsDictionary.KeyValue("FormDB_MySQLquery_closed", this.culture),
                                StringsDictionary.KeyValue("FormDB_MySQLquery_closed_header", this.culture),
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(-1);
            }

            int    r        = 0;
            string MySQLcmd = "";

            MySQLcmd = "SELECT COUNT(*) FROM "
                       + this.ServerInfo.Tablename
                       + " WHERE ( prefix BETWEEN inet6_aton('" + this.prefix.Split('/')[0] + "')"
                       + " AND inet6_aton('" + this.end.Split('/')[0] + "')"
                       + " AND parentpflen= " + parentpflen + " AND pflen= " + pflen + " ) ";

            OdbcCommand MyCommand = new OdbcCommand(MySQLcmd, this.MySQLconnection);

            try
            {
                MyDataReader = MyCommand.ExecuteReader();
                MyDataReader.Read();
                r = int.Parse(MyDataReader.GetString(0));

                MyDataReader.Close();
                if (MyDataReader is IDisposable)
                {
                    MyDataReader.Dispose();
                }
                return(r);
            }
            //catch (System.InvalidOperationException ex)
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message +
                                StringsDictionary.KeyValue("FormDB_MySQLquery_exception", this.culture),
                                StringsDictionary.KeyValue("FormDB_MySQLquery_exception_header", this.culture),
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(-1);
            }
        }
 public void SwitchLanguage(CultureInfo culture)
 {
     this.culture       = culture;
     this.Text          = StringsDictionary.KeyValue("DBinfo_Form.Text", this.culture);
     this.button1.Text  = StringsDictionary.KeyValue("DBinfo_button1.Text", this.culture);
     this.button2.Text  = StringsDictionary.KeyValue("DBinfo_button2.Text", this.culture);
     this.label1.Text   = StringsDictionary.KeyValue("DBinfo_label1.Text", this.culture);
     this.label2.Text   = StringsDictionary.KeyValue("DBinfo_label2.Text", this.culture);
     this.label3.Text   = StringsDictionary.KeyValue("DBinfo_label3.Text", this.culture);
     this.label4.Text   = StringsDictionary.KeyValue("DBinfo_label4.Text", this.culture);
     this.label5.Text   = StringsDictionary.KeyValue("DBinfo_label5.Text", this.culture);
     this.label6.Text   = StringsDictionary.KeyValue("DBinfo_label6.Text", this.culture);
     this.label7.Text   = StringsDictionary.KeyValue("DBinfo_label7.Text", this.culture);
     this.textBox6.Text = StringsDictionary.KeyValue("DBinfo_textBox6.Text", this.culture);
     this.ChangeUILanguage.Invoke(this.culture);
 }
        private void deletetoolStripMenuItem1_Click(object sender, EventArgs e)
        {
            if (this.listBox1.SelectedIndex % 11 != 0)
            {
                return;
            }
            else
            {
                string   s  = this.listBox1.SelectedItem.ToString().Split(' ')[1];
                string[] sa = s.Split('/');
                this.listBox1.Items.Clear();
                string MySQLcmd = "";
                int    r        = 0;

                if (sa[0] != null && sa[1] != null)
                {
                    MySQLcmd = "DELETE FROM "
                               + "`" + this.ServerInfo.DBname + "`.`" + this.ServerInfo.Tablename + "` "
                               + " WHERE"
                               + " ( prefix=inet6_aton('" + sa[0] + "') "
                               + " AND pflen=" + sa[1].ToString() + ");";

                    r = this.MySQLquery(sa, MySQLcmd, 3);

                    if (r == -1)
                    {
                        this.toolStripStatusLabel1.Text = "[ Error ]";
                        this.textBox9.Text = "[ ]";
                        return;
                    }

                    else if (r > 0)
                    {
                        this.toolStripStatusLabel1.Text =
                            StringsDictionary.KeyValue("FormDB_delrecord", this.culture);
                    }
                    else if (r == 0)
                    {
                        this.toolStripStatusLabel1.Text =
                            StringsDictionary.KeyValue("FormDB_norecord", this.culture);
                        return;
                    }

                    this.button2_Click(null, null);
                }
            }
        }
示例#28
0
        private void Button1_Click(object sender, EventArgs e)
        {
            if (this.textBox1.Text.Trim() == "")
            {
                MessageBox.Show("Address can not be blank", "Blank address", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            string[] fname = this.textBox1.Text.Trim().Split('/');
            this.fileName = fname[fname.Length - 1];    // last part of the URL is the filename

            this.progressBar1.Visible = true;
            this.label3.Visible       = true;
            this.label3.Text          = StringsDictionary.KeyValue("UpdateServiceNamesPortNumbers_label3.Text", this.culture);

            this.backgroundWorker1.RunWorkerAsync();
        }
示例#29
0
        private void textBox2_Leave(object sender, EventArgs e)
        {
            if (this.textBox2.Text.Trim() == "")
            {
                this.label5.ForeColor = Color.Red;
                this.label5.Text      = StringsDictionary.KeyValue("SaveAs_Click_e0", this.culture);
                return;
            }

            try
            {
                this.ToIndex = BigInteger.Parse(this.textBox2.Text, NumberStyles.Number);
            }
            catch
            {
                this.textBox2.Text = "";
                this.textBox2.Focus();
                this.label5.ForeColor = Color.Red;
                this.label5.Text      = StringsDictionary.KeyValue("SaveAs_Click_e0", this.culture);
                return;
            }

            if (this.ToIndex > (maxsubnet - 1))
            {
                this.textBox2.BackColor = Color.FromKnownColor(KnownColor.Info);
                this.textBox4.BackColor = Color.FromKnownColor(KnownColor.Info);
                this.textBox2.SelectAll();
                this.label5.ForeColor = Color.Red;
                this.label5.Text      = StringsDictionary.KeyValue("SaveAs_Click_e1", this.culture);
                return;
            }
            else if (this.ToIndex < this.FromIndex)
            {
                this.textBox2.BackColor = Color.FromKnownColor(KnownColor.Info);
                this.textBox2.SelectAll();
                this.label5.ForeColor = Color.Red;
                this.label5.Text      = StringsDictionary.KeyValue("SaveAs_Click_e2", this.culture);
                return;
            }
            else
            {
                this.textBox4.BackColor = Color.FromKnownColor(KnownColor.Control);
                this.label5.Text        = "";
            }
        }
        public void SwitchLanguage(CultureInfo culture)
        {
            this.culture = culture;

            this.Text = StringsDictionary.KeyValue("ServiceNamesPortNumbers_header.Text", this.culture);
            this.fileToolStripMenuItem.Text         = StringsDictionary.KeyValue("ServiceNamesPortNumbers_fileToolStripMenuItem.Text", this.culture);
            this.exitToolStripMenuItem.Text         = StringsDictionary.KeyValue("ServiceNamesPortNumbers_exitToolStripMenuItem.Text", this.culture);
            this.updateToolStripMenuItem.Text       = StringsDictionary.KeyValue("ServiceNamesPortNumbers_updateToolStripMenuItem.Text", this.culture);
            this.OnlineUpdatetoolStripMenuItem.Text = StringsDictionary.KeyValue("ServiceNamesPortNumbers_OnlineUpdatetoolStripMenuItem.Text", this.culture);
            this.checkBox1.Text             = StringsDictionary.KeyValue("ServiceNamesPortNumbers_checkBox1.Text", this.culture);
            this.label2.Text                = StringsDictionary.KeyValue("ServiceNamesPortNumbers_label2.Text", this.culture);
            this.toolStripStatusLabel1.Text = StringsDictionary.KeyValue("ServiceNamesPortNumbers_toolStripStatusLabel1.Text", this.culture)
                                              + this.dataGridView1.RowCount.ToString();
            this.toolStripStatusLabel2.Text = StringsDictionary.KeyValue("ServiceNamesPortNumbers_toolStripStatusLabel2.Text", this.culture)
                                              + this.fileName;

            this.ChangeUILanguage.Invoke(this.culture);
        }