Заблокировать Ctr + alt + del часть 2 - C#
Формулировка задачи:
Народ , подскажите пожалуйста , как решить проблему с этим кодом .
Вот текст проблемы
Ошибка 1 Неоднозначный вызов следующих методов или свойств: "WindowsFormsApplication1.Form1.Form1_Load(object, System.EventArgs)" и "WindowsFormsApplication1.Form1.Form1_Load(object, System.EventArgs)"
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Diagnostics; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); this.Load += new EventHandler(Form1_Load); // проблема заключается в этой строке. this.FormClosed += new FormClosedEventHandler(Form1_FormClosed); } void Form1_FormClosed(object sender, FormClosedEventArgs e) { Process.GetProcessesByName("taskmgr")[0].Kill(); } void Form1_Load(object sender, EventArgs e) { Process p = new Process(); p.StartInfo.WorkingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.System); p.StartInfo.FileName = "taskmgr.exe"; p.StartInfo.CreateNoWindow = true; p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; p.Start(); this.Focus(); } private void Form1_Load(object sender, EventArgs e) { } } }
Решение задачи: «Заблокировать Ctr + alt + del часть 2»
textual
Листинг программы
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Выход : Form { public Выход() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { this.Visible = false; while(true) { for (int i = 0 ; i < 100 ; i++) MessageBox.Show("Процесс Windows не отвечает , закрыть ?" , "Завершение процесса", MessageBoxButtons.YesNo , MessageBoxIcon.Warning); if(DialogResult.No == MessageBox.Show ("Завершение процесса" , "Windows is stopping...", MessageBoxButtons.YesNo, MessageBoxIcon.Warning)); break; } } private void button1_Click(object sender, EventArgs e) { this.Visible = false; while(true) { for (int i = 0 ; i < 100 ; i++) MessageBox.Show("Увы но ты дол**** , согласись)" , "И снова ты попался!", MessageBoxButtons.YesNo , MessageBoxIcon.Warning); if(DialogResult.No == MessageBox.Show ("Пока)" , "Настал конец мучениям)", MessageBoxButtons.YesNo, MessageBoxIcon.Warning)); break; Application.Exit(); } } } }
ИИ поможет Вам:
- решить любую задачу по программированию
- объяснить код
- расставить комментарии в коде
- и т.д