Пример #1
0
 private void FindHistory(string searchString)
 {
     if (searchString != string.Empty)
     {
         int index = ListBox1.FindString(searchString);
         if (index != -1)
         {
             ListBox1.SetSelected(index, true);
         }
         else
         {
             MessageBox.Show("could not match any history for " + TextBox1.Text);
         }
     }
 }
Пример #2
0
        private void Timer1_Tick(object sender, EventArgs e)
        {
//INSTANT C# TODO TASK: The 'On Error Resume Next' statement is not converted by Instant C#:
            On Error Resume Next
            string sys = Label4.Text;

            string[] x   = Microsoft.VisualBasic.Strings.Split(sys, "|1", -1, Microsoft.VisualBasic.CompareMethod.Binary);
            string[] x2  = Microsoft.VisualBasic.Strings.Split(sys, "|2", -1, Microsoft.VisualBasic.CompareMethod.Binary);
            string[] x3  = Microsoft.VisualBasic.Strings.Split(sys, "|4", -1, Microsoft.VisualBasic.CompareMethod.Binary);
            string   ip  = "0";
            string   sty = "0";

            TextBox4.Text  = x[1];            //user
            TextBox5.Text  = x[2];            //pass
            TextBox1.Text  = x[3];            //id
            TextBox10.Text = x[4];            //ip
            if (if0 == Convert.ToInt32("1"))  // منع التكرار
            {
                found();
                if0 = Convert.ToInt32("0");
            }
            ip  = x2[1];
            sty = x2[2];
            if (ip.Contains("."))
            {
                if (!string.IsNullOrEmpty("192.168.1.126"))
                {
                    int index = ListBox1.FindString("192.168.1.126");
                    if (index != -1)
                    {
                        ListBox1.SetSelected(index, true);
                        ListBox1.Items.Remove(ListBox1.SelectedItem);
                    }
                    else
                    {
                        TextBox5.Text = "";
                        ListBox1.Items.Add(ip + " - " + sty);
                        Label4.Text = "";
                        ip          = "0";
                        sty         = "0";
                    }
                }
            }
            if (Label4.Text.Contains("|4"))
            {
                string   str    = null;
                string[] strArr = null;
                int      count  = 0;
                str    = Label4.Text;
                strArr = str.Split("|4");
                for (count = 1; count < x3.Length; count++)
                {
                    if (x3[count].Contains(" "))
                    {
                    }
                    else
                    {
                        ListBox2.Items.Add(x3[count]);
                    }
                }
                Label4.Text = "";
            }
            string[] x4  = Microsoft.VisualBasic.Strings.Split(sys, "|up", -1, Microsoft.VisualBasic.CompareMethod.Binary);
            string   id2 = null;

            if (sys.Contains("|up"))
            {
            }
        }