Exemplo n.º 1
0
        private void button15_Click(object sender, EventArgs e)
        {
            DBClass classDB = new DBClass();

            classDB.SaveNesovpadStrokText(SaveStroki1, SaveStroki2);
        }
Exemplo n.º 2
0
        private void button3_Click(object sender, EventArgs e)
        {
            int    s1             = 0;
            int    s2             = 0;
            int    numberOfLines1 = richTextBox1.Lines.Length;
            int    numberOfLines2 = richTextBox2.Lines.Length;
            string stroki         = "";
            string stroki1        = "";
            string stroki2        = "";

            if (numberOfLines1 == numberOfLines2)
            {
                s1 = numberOfLines1; s2 = 0;
            }
            else
            if (numberOfLines1 < numberOfLines2)
            {
                s1 = numberOfLines1; s2 = numberOfLines2;
            }
            else
            {
                s1 = numberOfLines2; s2 = numberOfLines1;
            }
            for (int i = 0; i < s1; i++)
            {
                if (Equals(richTextBox1.Lines[i], richTextBox2.Lines[i]) == false)
                {
                    richTextBox1.SelectionStart  = richTextBox1.GetFirstCharIndexFromLine(i);
                    richTextBox1.SelectionLength = richTextBox1.Lines[i].Length;
                    richTextBox1.SelectionColor  = Color.Red;
                    stroki  += richTextBox1.Lines[i].ToString() + Environment.NewLine;
                    stroki1 += richTextBox1.Lines[i].ToString() + Environment.NewLine;
                    richTextBox2.SelectionStart  = richTextBox2.GetFirstCharIndexFromLine(i);
                    richTextBox2.SelectionLength = richTextBox2.Lines[i].Length;
                    richTextBox2.SelectionColor  = Color.Red;
                    stroki  += richTextBox2.Lines[i].ToString() + Environment.NewLine;
                    stroki2 += richTextBox2.Lines[i].ToString() + Environment.NewLine;
                }
            }
            for (int i = s1; i < s2; i++)
            {
                if (s2 == numberOfLines2)
                {
                    richTextBox2.SelectionStart  = richTextBox2.GetFirstCharIndexFromLine(i);
                    richTextBox2.SelectionLength = richTextBox2.Lines[i].Length;
                    richTextBox2.SelectionColor  = Color.Red;
                    stroki  += richTextBox2.Lines[i].ToString() + Environment.NewLine;
                    stroki2 += richTextBox2.Lines[i].ToString() + Environment.NewLine;
                }
                else
                {
                    richTextBox1.SelectionStart  = richTextBox1.GetFirstCharIndexFromLine(i);
                    richTextBox1.SelectionLength = richTextBox1.Lines[i].Length;
                    richTextBox1.SelectionColor  = Color.Red;
                    stroki  += richTextBox1.Lines[i].ToString() + Environment.NewLine;
                    stroki1 += richTextBox1.Lines[i].ToString() + Environment.NewLine;
                }
            }
            SaveStroki  = stroki;
            SaveStroki1 = stroki1;
            SaveStroki2 = stroki2;
            DBClass classDB = new DBClass();

            classDB.Information("online", "string comparsion", DateTime.Now);
        }