Пример #1
0
 private void настройкиToolStripMenuItem_Click(object sender, EventArgs e)
 {
     FormSettings form = new FormSettings();
     form.Show();
 }
Пример #2
0
        public FormMain()
        {


            InitializeComponent();
            try
            {
                string buffer;
                using (var sr = new StreamReader(@"Client_info/data_info.txt"))
                {
                    buffer = sr.ReadToEnd();
                }
                string[] connect_info = buffer.Split(':');

                buttonyes.Visible = false;
                buttonno.Visible = false;
                ip = IPAddress.Parse(connect_info[0]);
                port = int.Parse(connect_info[1]);
                label1.ForeColor = Color.Green;
                label1.Text = "Настройки: \n IP сервера: " + connect_info[0] + "\n Порт сервера:" + connect_info[1];
                label1.Text = "Connecting to server...";
                ConnectAsync(connect_info[0], connect_info[1].Replace("\r\n", string.Empty));


                // OpenVideo();


                this.WindowState = FormWindowState.Minimized;
                this.ShowInTaskbar = false;
                notifyIcon1.Visible = true;
                this.Hide();

                //очистить картинку
                pictureBox1.Image = null;
                //pictureBox1.Load(@"Client_info/lena.jpg");

            }
            catch (Exception ex)
            {
                label1.ForeColor = Color.Red;
                label1.Text = "Настройки не найдены";
                FormSettings form = new FormSettings();
                form.Show();
            }
        }