예제 #1
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            int saat;

            saat = Convert.ToInt32(textBox1.Text);
            if (DateTime.Now.Hour == saat && DateTime.Now.Minute == 10 && DateTime.Now.Second == 00) //50 Dakika
            {
                Form2 yeni = new Form2();
                yeni.Show();
            }
            if (DateTime.Now.Hour == saat && DateTime.Now.Minute == 20 && DateTime.Now.Second == 00) //40 Dakika
            {
                Form5 yeni = new Form5();
                yeni.Show();
            }
            if (DateTime.Now.Hour == saat && DateTime.Now.Minute == 30 && DateTime.Now.Second == 00) //30 Dakika
            {
                Form6 yeni = new Form6();
                yeni.Show();
            }
            if (DateTime.Now.Hour == saat && DateTime.Now.Minute == 40 && DateTime.Now.Second == 00)  //20 Dakika
            {
                Form7 yeni = new Form7();
                yeni.Show();
            }
            if (DateTime.Now.Hour == saat && DateTime.Now.Minute == 45 && DateTime.Now.Second == 00) //15 Dakika
            {
                Form8 yeni = new Form8();
                yeni.Show();
            }
            if (DateTime.Now.Hour == saat && DateTime.Now.Minute == 50 && DateTime.Now.Second == 00) //10 Dakika
            {
                Form9 yeni = new Form9();
                yeni.Show();
            }
            if (DateTime.Now.Hour == saat && DateTime.Now.Minute == 55 && DateTime.Now.Second == 00) //5 Dakika
            {
                Form10 yeni = new Form10();
                yeni.Show();
            }
            if (DateTime.Now.Hour == saat && DateTime.Now.Hour == saat && DateTime.Now.Minute == 56 && DateTime.Now.Second == 00)  //4 Dakika
            {
                Form11 yeni = new Form11();
                yeni.Show();
            }
            if (DateTime.Now.Hour == saat && DateTime.Now.Minute == 57 && DateTime.Now.Second == 00) //3 Dakika
            {
                Form12 yeni = new Form12();
                yeni.Show();
            }
            if (DateTime.Now.Hour == saat && DateTime.Now.Minute == 58 && DateTime.Now.Second == 00) //2 Dakika
            {
                Form13 yeni = new Form13();
                yeni.Show();
            }
            if (DateTime.Now.Hour == saat && DateTime.Now.Minute == 59 && DateTime.Now.Second == 00) //1 Dakika
            {
                Form14 yeni = new Form14();
                yeni.Show();
            }
            if (DateTime.Now.Hour == saat + 1 && DateTime.Now.Minute == 00 && DateTime.Now.Second == 00) //KatılımSonlandı
            {
                Form15 yeni = new Form15();
                yeni.Show();
                Form16 sonuc = new Form16();
                sonuc.Show();
                this.Hide();
                timer1.Stop();
            }
        }
예제 #2
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;
     }
 }
예제 #3
0
        /*EPM Review Tool*/
        private void skinButton1_Click(object sender, EventArgs e)
        {
            Form frm12 = new Form12();

            frm12.Show();
        }