• 大小: 0.13M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2020-12-14
  • 语言: C#
  • 标签: C#  定时  关机  

资源简介


资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Runtime.InteropServices;

namespace 定时关机小程序
{


    public partial class Form1 : Form
    {
        /// 
        /// 全局变量
        /// 

        DateTime datetimeNow;
        bool status = true;

        [DllImport(“user32.dll“ EntryPoint = “ExitWindowsEx“ CharSet = CharSet.Ansi)]
        private static extern int ExitWindowsEx(int uFlags int dwReserved);

        public void zhuxiao() //注销
        {
            ExitWindowsEx(0 0);
        }

        public void guanji()//关机
        {
            try
            {
                Process.Start(“Shutdown.exe“ “ -s -t 0

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-12-27 12:48  PowerTimerTool-master\
     文件         885  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序.sln
     文件       20480  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序.suo
     目录           0  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序\
     文件       19800  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序\Form1.Designer.cs
     文件       17036  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序\Form1.cs
     文件       19478  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序\Form1.resx
     文件         462  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序\Program.cs
     目录           0  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序\Properties\
     文件        1338  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序\Properties\AssemblyInfo.cs
     文件        2821  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序\Properties\Resources.Designer.cs
     文件        5496  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序\Properties\Resources.resx
     文件        1076  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序\Properties\Settings.Designer.cs
     文件         242  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序\Properties\Settings.settings
     目录           0  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序\bin\
     目录           0  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序\bin\Debug\
     文件       35328  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序\bin\Debug\定时关机小程序.exe
     文件       38400  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序\bin\Debug\定时关机小程序.pdb
     文件       14848  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序\bin\Debug\定时关机小程序.vshost.exe
     文件         479  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序\bin\Debug\定时关机小程序.vshost.exe.manifest
     目录           0  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序\bin\Release\
     文件       34304  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序\bin\Release\定时关机小程序.exe
     文件       34304  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序\bin\Release\定时关机小程序.pdb
     文件       14848  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序\bin\Release\定时关机小程序.vshost.exe
     文件         479  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序\bin\Release\定时关机小程序.vshost.exe.manifest
     目录           0  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序\obj\
     目录           0  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序\obj\x86\
     目录           0  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序\obj\x86\Debug\
     文件        5403  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     文件        9440  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序\obj\x86\Debug\定时关机小程序.Form1.resources
     文件         180  2013-12-27 12:48  PowerTimerTool-master\定时关机小程序\obj\x86\Debug\定时关机小程序.Properties.Resources.resources
............此处省略16个文件信息

评论

共有 条评论