Beispiel #1
0
        private void comboBox3_SelectedIndexChanged(object sender, EventArgs e)
        {
            bool   Check  = false;
            int    type   = 0; // 0 - File, 1 - srvr, 2 - ws
            string IBPath = null;

            GetPath.CheckDBPath(comboBox3.SelectedItem.ToString(), ref Check, ref type, ref IBPath);
            switch (type)
            {
            case 0:
                if (Check == true)
                {
                    label7.Text       = IBPath;
                    pictureBox4.Image = Properties.Resources.Ok;
                    IBChen            = true;
                    break;
                }
                else
                {
                    label7.Text       = IBPath;
                    pictureBox4.Image = Properties.Resources.Error;
                    //toolTip.RemoveAll();
                    toolTip.SetToolTip(pictureBox4, "Файл базы данных не обнаружен");
                    IBChen = false;
                    break;
                }

            case 1:
                label7.Text       = IBPath;
                pictureBox4.Image = Properties.Resources.What;
                //toolTip.RemoveAll();
                toolTip.SetToolTip(pictureBox4, "Серверная база, нужно проверить её существование!");
                IBChen = true;
                break;

            case 2:
                label7.Text       = IBPath;
                pictureBox4.Image = Properties.Resources.Error;
                //toolTip.RemoveAll();
                toolTip.SetToolTip(pictureBox4, "Это публикация!!!");
                IBChen = false;
                break;
            }
        }
Beispiel #2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     GetPath.GetApachePath();
     GetPath.GetPathInstall1c();
     GetPath.GetIbName();
     foreach (string i in IB)
     {
         var bytes = Encoding.GetEncoding("windows-1251").GetBytes(i);
         var res   = Encoding.GetEncoding("UTF-8").GetString(bytes);
         comboBox3.Items.Add(res);
     }
     if (x32 == true)
     {
         label2.ForeColor  = Color.Green;
         pictureBox1.Image = Properties.Resources.Ok;
         foreach (var i in InstallPlatforms32)
         {
             comboBox1.Items.Add(i.Replace(GetPath.onecv832 + @"\", ""));
         }
     }
     else
     {
         label2.ForeColor  = Color.Red;
         pictureBox1.Image = Properties.Resources.Error;
         comboBox1.Items.Add("N/a");
         checkBox1.Enabled = false;
     }
     if (x64 == true)
     {
         label3.ForeColor  = Color.Green;
         pictureBox2.Image = Properties.Resources.Ok;
         foreach (var i in InstallPlatforms64)
         {
             comboBox2.Items.Add(i.Replace(GetPath.onecv864 + @"\", ""));
         }
     }
     else
     {
         label3.ForeColor  = Color.Red;
         pictureBox2.Image = Properties.Resources.Error;
         comboBox2.Items.Add("N/a");
         checkBox2.Enabled = false;
     }
     if (ApacheInstall == true)
     {
         textBox1.Text     = GetPath.ApachePath;
         label5.ForeColor  = Color.Green;
         pictureBox3.Image = Properties.Resources.Ok;
     }
     else
     {
         label5.ForeColor  = Color.Red;
         pictureBox3.Image = Properties.Resources.Error;
     }
     if (GetPath.ApacheConfPath() == true)
     {
         textBox2.Text     = GetPath.ApacheConfP;
         pictureBox5.Image = Properties.Resources.Ok;
         ConfPath          = true;
     }
     else
     {
         textBox2.Text     = GetPath.ApacheConfP;
         pictureBox5.Image = Properties.Resources.Error;
         toolTip.SetToolTip(pictureBox5, "Директория не существует");
         ConfPath = false;
     }
     if (x32 == false && x64 == false)
     {
         Platform = false;
     }
     else
     {
         Platform = true;
     }
     comboBox1.SelectedIndex = comboBox1.Items.Count - 1;
     comboBox2.SelectedIndex = comboBox2.Items.Count - 1;
     comboBox3.SelectedIndex = 0;
     checkBox1.Text          = "Использовать";
     checkBox2.Text          = "Использовать";
     pictureBox1.Size        = new Size(20, 20);
     pictureBox2.Size        = new Size(20, 20);
     pictureBox3.Size        = new Size(20, 20);
     pictureBox4.Size        = new Size(20, 20);
     pictureBox5.Size        = new Size(20, 20);
     pictureBox6.Size        = new Size(20, 20);
     pictureBox7.Size        = new Size(20, 20);
     pictureBox8.Size        = new Size(20, 20);
     pictureBox1.SizeMode    = PictureBoxSizeMode.StretchImage;
     pictureBox2.SizeMode    = PictureBoxSizeMode.StretchImage;
     pictureBox3.SizeMode    = PictureBoxSizeMode.StretchImage;
     pictureBox4.SizeMode    = PictureBoxSizeMode.StretchImage;
     pictureBox5.SizeMode    = PictureBoxSizeMode.StretchImage;
     pictureBox6.SizeMode    = PictureBoxSizeMode.StretchImage;
     pictureBox7.SizeMode    = PictureBoxSizeMode.StretchImage;
     pictureBox8.SizeMode    = PictureBoxSizeMode.StretchImage;
     pictureBox7.Image       = Properties.Resources.Error;
     pictureBox8.Image       = Properties.Resources.Ok;
     toolTip.SetToolTip(pictureBox7, "Не может быть пустым!");
     button3.Visible    = false;
     textBox3.MaxLength = 5;
     textBox4.MaxLength = 30;
     textBox3.Text      = "80";
     textBox5.Text      = $"Apache_{textBox4.Text}_{textBox3.Text}";
 }