📄 form1.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WinAppTest10
{
public partial class Form1 : Form
{
int time = 10;
public Form1()
{
InitializeComponent();
}
private void FormClose(int i)
{
if (i == 1)
System.Diagnostics.Process.Start
("C:\\WINDOWS\\system32\\sol.exe");
else
System.Diagnostics.Process.Start
("C:\\WINDOWS\\system32\\winmine.exe");
this.Close();
}
private void Form1_Load(object sender, EventArgs e)
{
timer1.Interval = 1000;
timer1.Enabled = true;
}
private void Form1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar ==(char) Keys.Enter)
FormClose(1);
else
FormClose(2);
}
private void Form1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
FormClose(1);
else
FormClose(2);
}
private void timer1_Tick(object sender, EventArgs e)
{
label1.Text = "剩余时间:----" + time;
if (time == 0)
{
FormClose(1);
}
time--;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -