Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using System.Diagnostics;
- using System.IO;
- using System.Threading;
- using System.Runtime.InteropServices;
- namespace ComputerController
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- MaximumSize = new Size(521, 360);
- MinimumSize = new Size(521, 360);
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- private void button1_Click(object sender, EventArgs e)
- {
- Process.Start("shutdown", "/s /t 0");
- }
- private void button2_Click(object sender, EventArgs e)
- {
- Process.Start("shutdown", "/r /t 0");
- }
- private void button3_Click(object sender, EventArgs e)
- {
- //textBox1 - X textBox2 - Y
- curpos(int.Parse(textBox1.Text), int.Parse(textBox2.Text));
- }
- private void button4_Click(object sender, EventArgs e)
- {
- MessageBox.Show(richTextBox1.Text);
- }
- private void richTextBox2_TextChanged(object sender, EventArgs e)
- {
- }
- private void button5_Click(object sender, EventArgs e)
- {
- timer1.Stop();
- }
- int i = 0;
- private void timer1_Tick(object sender, EventArgs e)
- {
- textBox3.Text = Convert.ToString(i);
- i++;
- }
- private void button6_Click(object sender, EventArgs e)
- {
- timer1.Enabled = true;
- timer1.Start();
- }
- private void button7_Click(object sender, EventArgs e)
- {
- timer1.Stop();
- i = 0;
- textBox3.Text = "";
- }
- private void button8_Click(object sender, EventArgs e)
- {
- wyszukaj(textBox4.Text);
- }
- private void textBox4_TextChanged(object sender, EventArgs e)
- {
- }
- private void wyszukaj(string w)
- {
- Process.Start("http://google.pl/search?q=" + w);
- }
- private void button9_Click(object sender, EventArgs e)
- {
- double wyn;
- switch (listBox1.SelectedIndex)
- {
- case 0:
- wyn = (double.Parse(textBox5.Text) + double.Parse(textBox6.Text));
- MessageBox.Show(wyn.ToString());
- break;
- case 1:
- wyn = (double.Parse(textBox5.Text) - double.Parse(textBox6.Text));
- MessageBox.Show(wyn.ToString());
- break;
- case 2:
- wyn = (double.Parse(textBox5.Text) * double.Parse(textBox6.Text));
- MessageBox.Show(wyn.ToString());
- break;
- case 3:
- wyn = (double.Parse(textBox5.Text) / double.Parse(textBox6.Text));
- MessageBox.Show(wyn.ToString());
- break;
- case 4:
- wyn = Math.Pow(double.Parse(textBox5.Text), double.Parse(textBox6.Text));
- MessageBox.Show(wyn.ToString());
- break;
- case 5:
- wyn = pierwiastek(double.Parse(textBox5.Text), double.Parse(textBox6.Text));
- MessageBox.Show(wyn.ToString());
- break;
- case 6:
- wyn = Math.Log(double.Parse(textBox6.Text), double.Parse(textBox5.Text));
- MessageBox.Show(wyn.ToString());
- break;
- case 7:
- wyn = silnia(int.Parse(textBox5.Text));
- MessageBox.Show(wyn.ToString());
- break;
- }
- }
- private double pierwiastek(double x, double y)
- {
- return Math.Pow(x, (1 / y));
- }
- private int silnia(int x)
- {
- for (int i = x - 1; i > 1; --i) x = x * i;
- return x;
- }
- private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (listBox1.SelectedIndex == 7) { textBox6.Hide(); label5.Hide(); }
- else{ textBox6.Show(); label5.Show(); }
- }
- private void button10_Click_1(object sender, EventArgs e)
- {
- if (checkBox1.Checked == true) File.Delete(@"" + textBox7.Text);
- }
- private void groupBox7_Enter(object sender, EventArgs e)
- {
- }
- private void curpos(int x, int y)
- {
- Cursor.Position = new Point(x, y);
- }
- private void label4_Click(object sender, EventArgs e)
- {
- }
- private void button11_Click(object sender, EventArgs e)
- {
- Process.Start("https://pastebin.com/");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement