1.打開VS2019,建立界面和按鈕orm
2. 代碼以下:blog
private void button1_Click(object sender, EventArgs e)
{
downpc(txttime.Text);
}string
private static void downpc(string time)
{
Process.Start("shutdown", "/s /t "+time);object
}im
private void button2_Click(object sender, EventArgs e)
{
Process.Start("shutdown", "-a");
}static
private void Form1_Load(object sender, EventArgs e)
{
}img
private void LinkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start("https://www.cnblogs.com/pingg2019/");
}ping