- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
static void Reading_instruction(string Command)
{
	string[] CommandLine = null;
	try
	{
		#region Команды консоли.
		#region -boxmessage выводит сообщение в диалоговом окне.
				
		//Пример: -boxmessage:Привет!*/
				
		if (Command.ToLower().StartsWith("-boxmessage"))
		{
			CommandLine = Command.Split(new char[] {':'});
			System.Windows.Forms.MessageBox.Show(CommandLine[1]);
		}
		#endregion
		#region -errormessage выводит сообщение c ошибкой в диалоговом окне.
				
		//Пример: -errormessage:Вы забанены!!!:Критическая ошибка!
				
		if (Command.ToLower().StartsWith("-errormessage"))
		{
			CommandLine = Command.Split(new char[] {':'});
			System.Windows.Forms.MessageBox.Show(CommandLine[1], CommandLine[2], System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error, System.Windows.Forms.MessageBoxDefaultButton.Button1, System.Windows.Forms.MessageBoxOptions.ServiceNotification);
		}
		#endregion
		#region -consolemessage выводит текст в консоль.
				
		//Пример: -consolemessage:Привет!
				
		if (Command.ToLower().StartsWith("-consolemessage"))
		{
			CommandLine = Command.Split(new char[] {':'});
			Console.WriteLine(CommandLine[1]);
		}
		#endregion
		#region -killprocess убивает процесс.
				
		//Пример: -killprocess explorer
				
		if (Command.ToLower().StartsWith("-killprocess"))
		{
			CommandLine = Command.Split(new char[] {' '});
			System.Diagnostics.Process[] myProcesses = System.Diagnostics.Process.GetProcessesByName(CommandLine[1]);
			foreach (System.Diagnostics.Process instance in myProcesses)
			{
				instance.Kill();
			}
		}
		#endregion
		#region -startprocess запускает новый процесс или открывает файл.
				
		//Пример: -startprocess explorer.exe
				
		if (Command.ToLower().StartsWith("-startprocess"))
		{
			CommandLine = Command.Split(new char[] {' '});
			System.Diagnostics.Process.Start(CommandLine[1]);
		}
		#endregion
		#region -createfile создает файл.
				
		//Пример: -createfile С:\TestFile.txt
				
		if (Command.ToLower().StartsWith("-createfile"))
		{
			CommandLine = Command.Split(new char[] {' '});
			System.IO.File.Create(CommandLine[1]);
		}
		#endregion
		#region -deletefile удаляет файл.
				
		//Пример: -deletefile С:\TestFile.txt
				
		if (Command.ToLower().StartsWith("-deletefile"))
		{
			CommandLine = Command.Split(new char[] {' '});
			System.IO.File.Delete(CommandLine[1]);
		}
		#endregion
		#region -shutdown выключает компьютер.
				
		//Пример: -shutdown
				
		if (Command.ToLower().StartsWith("-shutdown"))
		System.Diagnostics.Process.Start("shutdown", "/s /t 0");
		#endregion
		#region -reboot перезагружает компьютер.
				
		//Пример: -reboot
				
		if (Command.ToLower().StartsWith("-reboot"))
			System.Diagnostics.Process.Start("shutdown", "/r /t 0");
		#endregion







 Follow us!
 Follow us!