Exemplo n.º 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     Form4 form4 = new Form4();
     this.Hide();
     form4.ShowDialog();
     this.Close();
 }
Exemplo n.º 2
0
 private void button3_Click(object sender, EventArgs e)
 {
     Form4 step3 = new Form4();
     step3.ShowDialog();
 }
Exemplo n.º 3
0
 private void copyRight_Click(object sender, EventArgs e)
 {
     Form4 copyRights = new Form4();
     copyRights.ShowDialog();
 }
Exemplo n.º 4
0
 private void button2_Click(object sender, EventArgs e)
 {
     Form4 f = new Form4();
     this.Hide();
     f.Show();
 }
Exemplo n.º 5
0
        private void button15_Click(object sender, EventArgs e)
        {
            Form4 f4 = new Form4();

            f4.Show();
        }
Exemplo n.º 6
0
        private void timer2_Tick(object sender, EventArgs e)
        {
            string connect = "Server=127.0.0.1;port=3306;Database=phplogin;Uid = root;password = amber";
            MySqlConnection com = new MySqlConnection(connect);
            MySqlCommand Comanda = com.CreateCommand();
            Comanda.CommandText = "Select * from comments where user ='******' order by id ASC";
            com.Open();
            bool k = false;
            bool l = false;
            MySqlDataReader row = Comanda.ExecuteReader();
            while (row.Read())
            {
                sender = row["sender"].ToString();
                DateTime dat = Convert.ToDateTime(row["date"].ToString());
                if (DateTime.Compare(dat, data) > 0)
                {
                        foreach (Form OpenForm in Application.OpenForms)
                        {
                            if (OpenForm.Text == row["sender"].ToString())
                            {
                                l = true;
                                Form4 b = (Form4)OpenForm;
                                b.timer1.Enabled = true;
                                b.datatext = "aa";
                            }
                        }
                        if (l == false)
                        {

                            Form4 f3 = new Form4();
                            f3.conectare(a, row["sender"].ToString(), row["text"].ToString());
                            f3.Show();

                        }
                        k = true;

                }
            }
            com.Close();
            if (k == true)
            {
                data = DateTime.Now;

            }
        }
Exemplo n.º 7
0
 public Form5()
 {
     frm = new Form4(this);
     InitializeComponent();
 }
 private void button5_Click(object sender, EventArgs e)
 {
     Form4 okno = new Form4();
     okno.ShowDialog();
 }
Exemplo n.º 9
0
        private void panel_DClick(string user, string receiver)
        {
            bool l = false;
            foreach (Form OpenForm in Application.OpenForms)
            {
                if (OpenForm.Text == receiver)
                {
                    l = true;
                    Form4 b = (Form4)OpenForm;
                    b.Focus();
                }
            }
            if (l == false)
            {

                Form4 f2 = new Form4();
                f2.conectare(user, receiver , "");
                f2.datatext = "";
                f2.Show();

            }
        }
        private void btnOk_Click(object sender, EventArgs e)
        {
            Form form = new Form4();

            form.ShowDialog();
        }
Exemplo n.º 11
0
        private void gananciasToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form4 Balance = new Form4();

            Balance.Show();
        }
Exemplo n.º 12
0
 private void exec_cmd(String cmd)
 {
     String[] fcmd = cmd.Split(' ');
     if (fcmd[0] == "echo")
     {
         int    x    = 0;
         String outl = "";
         outl = "OS" + Globals.curdir + ">";
         foreach (String pcmd in fcmd)
         {
             if (x != 0)
             {
                 outl = outl + " " + pcmd;
             }
             x = 69;
         }
         label1.Text = outl;
     }
     else if (fcmd[0] == "file-manager")
     {
         Form4 newf = new Form4();
         newf.MdiParent = this.ParentForm;
         newf.Show();
     }
     else if (fcmd[0] == "text-editor")
     {
         Form2 newf = new Form2();
         newf.MdiParent = this.ParentForm;
         newf.Show();
     }
     else if (fcmd[0] == "calculator")
     {
         Form8 newf = new Form8();
         newf.MdiParent = this.ParentForm;
         newf.Show();
     }
     else if (fcmd[0] == "media-player")
     {
         Form9 newf = new Form9();
         newf.MdiParent = this.ParentForm;
         newf.Show();
     }
     else if (fcmd[0] == "cpu-monitor")
     {
         Form12 newf = new Form12();
         newf.MdiParent = this.ParentForm;
         newf.Show();
     }
     else if (fcmd[0] == "calendar")
     {
         Form13 newf = new Form13();
         newf.MdiParent = this.ParentForm;
         newf.Show();
     }
     else if (fcmd[0] == "cp")//Not working
     {
         String at = Application.StartupPath + Globals.curdir;
         System.Diagnostics.Process process = new System.Diagnostics.Process();
         process.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
         process.StartInfo.FileName    = "cmd.exe";
         process.StartInfo.Arguments   = "/C copy \"" + at + "\\" + fcmd[1] + "\" \"" + at + "\\" + fcmd[2] + "\"";
         process.Start();
         label1.Text = "/C copy " + at + "\\" + fcmd[1] + '\n' + at + "\\" + fcmd[2];
     }
     else if (fcmd[0] == "mkdir")
     {
         String at = Application.StartupPath + Globals.curdir;
         System.Diagnostics.Process process = new System.Diagnostics.Process();
         process.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
         process.StartInfo.FileName    = "cmd.exe";
         process.StartInfo.Arguments   = "/C mkdir \"" + at + "\\" + fcmd[1] + "\"";
         String outl = "OS" + Globals.curdir + ">";
         outl        = outl + "Created directory. ";
         label1.Text = outl;
         process.Start();
     }
     else if (fcmd[0] == "touch")
     {
         String at = Application.StartupPath + Globals.curdir;
         System.Diagnostics.Process process = new System.Diagnostics.Process();
         process.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
         process.StartInfo.FileName    = "cmd.exe";
         process.StartInfo.Arguments   = "/C echo.> \"" + at + "\\" + fcmd[1] + "\"";
         process.Start();
         String outl = "OS" + Globals.curdir + ">";
         outl        = outl + "Created file.";
         label1.Text = outl;
     }
     else if (fcmd[0] == "ls")
     {
         String[] dir  = Directory.GetDirectories(Application.StartupPath + Globals.curdir);
         String   outl = "OS" + Globals.curdir + ">";
         outl = outl + '\n';
         foreach (String word in dir)
         {
             int m = word.Length - 1;
             while (m >= 0 && word[m] != '\\')
             {
                 m--;
             }
             String nw = word.Substring(m + 1);
             outl = outl + nw;
             outl = outl + '\n';
         }
         String[] dir2 = Directory.GetFiles(Application.StartupPath + Globals.curdir);
         foreach (String word in dir2)
         {
             int m = word.Length - 1;
             while (m >= 0 && word[m] != '\\')
             {
                 m--;
             }
             String nw = word.Substring(m + 1);
             outl = outl + nw;
             outl = outl + '\n';
         }
         label1.Text = outl;
     }
     else if (fcmd[0] == "cd")
     {
         if (fcmd[1] == "..")
         {
             String outl = "";
             String temp = "";
             temp = Globals.curdir;
             int x = temp.Length;
             x = x - 2;
             while (x >= 0 && temp[x] != '\\')
             {
                 x--;
             }
             if (x >= 0)
             {
                 Globals.curdir = temp.Substring(0, x);
                 outl           = "OS" + Globals.curdir + ">";
                 label1.Text    = outl;
             }
         }
         else
         {
             int    x    = 0;
             int    f    = 0;
             String outl = "OS";
             foreach (String pcmd in fcmd)
             {
                 String[] dir = Directory.GetDirectories(Application.StartupPath + Globals.curdir);
                 foreach (String word in dir)
                 {
                     int m = word.Length - 1;
                     while (m >= 0 && word[m] != '\\')
                     {
                         m--;
                     }
                     String nw = word.Substring(m + 1);
                     if (pcmd == nw)
                     {
                         if (x != 0)
                         {
                             Globals.curdir = Globals.curdir + "\\" + pcmd;
                             f = 69;
                         }
                     }
                 }
                 x = 69;
             }
             if (f != 69)
             {
                 outl        = "OS" + Globals.curdir + ">";
                 outl        = outl + " " + "The specified directory doesn't exist!";
                 label1.Text = outl;
             }
             else
             {
                 outl        = "OS" + Globals.curdir + ">";
                 outl        = outl + " " + "(Y)";
                 label1.Text = outl;
             }
         }
     }
     else
     {
         String outl;
         outl        = "OS" + Globals.curdir + ">";
         outl        = outl + " " + "Invalid Command";
         label1.Text = outl;
     }
 }
Exemplo n.º 13
0
        private void copyRight_Click(object sender, EventArgs e)
        {
            Form4 copyRights = new Form4();

            copyRights.ShowDialog();
        }
Exemplo n.º 14
0
        private void buscarAlumnoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form4 frm4 = new Form4();

            frm4.Show();
        }