1.打开VS2019,创建界面和按钮
2. 代码如下:
private void button1_Clickobject sender, EventArgs e)
{
downpctxttime.Text);
}
private static void downpcstring time)
{
Process.Start”shutdown”, “/s /t “+time);
}
private void button2_Clickobject sender, EventArgs e)
{
Process.Start”shutdown”, “-a”);
}
private void Form1_Loadobject sender, EventArgs e)
{
}
private void LinkLabel1_LinkClickedobject sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start”https://www.cnblogs.com/pingg2019/”);
}