• 大小: 0.63M
    文件类型: .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.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender EventArgs e)
        {

        }

        private void button1_Click(object sender EventArgs e)
        {
            ScreenAct.PreventSleep(true);
            MessageBox.Show(“您已禁用休眠功能“);
        }

        private void button2_Click(object sender EventArgs e)
        {
            ScreenAct.ResotreSleep();
            MessageBox.Show(“您已恢复休眠功能“);

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-06-04 14:21  WindowsFormsApp1\
     目录           0  2019-06-04 14:21  WindowsFormsApp1\.vs\
     目录           0  2019-06-04 14:21  WindowsFormsApp1\.vs\WindowsFormsApp1\
     目录           0  2019-06-04 14:21  WindowsFormsApp1\.vs\WindowsFormsApp1\v15\
     文件       55808  2019-06-05 09:33  WindowsFormsApp1\.vs\WindowsFormsApp1\v15\.suo
     目录           0  2019-06-04 14:21  WindowsFormsApp1\.vs\WindowsFormsApp1\v15\Server\
     目录           0  2019-06-04 14:21  WindowsFormsApp1\.vs\WindowsFormsApp1\v15\Server\sqlite3\
     文件           0  2019-06-04 14:21  WindowsFormsApp1\.vs\WindowsFormsApp1\v15\Server\sqlite3\db.lock
     文件        4096  2019-06-04 14:21  WindowsFormsApp1\.vs\WindowsFormsApp1\v15\Server\sqlite3\storage.ide
     文件       32768  2019-06-05 09:31  WindowsFormsApp1\.vs\WindowsFormsApp1\v15\Server\sqlite3\storage.ide-shm
     文件     1425552  2019-06-05 09:31  WindowsFormsApp1\.vs\WindowsFormsApp1\v15\Server\sqlite3\storage.ide-wal
     目录           0  2019-06-05 09:33  WindowsFormsApp1\WindowsFormsApp1\
     文件        1147  2019-06-04 14:21  WindowsFormsApp1\WindowsFormsApp1.sln
     文件         187  2019-06-04 14:21  WindowsFormsApp1\WindowsFormsApp1\App.config
     目录           0  2019-06-04 14:21  WindowsFormsApp1\WindowsFormsApp1\bin\
     目录           0  2019-06-05 09:33  WindowsFormsApp1\WindowsFormsApp1\bin\Debug\
     文件         187  2019-06-04 14:21  WindowsFormsApp1\WindowsFormsApp1\bin\Debug\WindowsFormsApp1.exe.config
     文件       32256  2019-06-05 09:31  WindowsFormsApp1\WindowsFormsApp1\bin\Debug\WindowsFormsApp1.pdb
     文件        9216  2019-06-05 09:31  WindowsFormsApp1\WindowsFormsApp1\bin\Debug\休眠禁用.exe
     文件         858  2019-06-05 09:33  WindowsFormsApp1\WindowsFormsApp1\Form1.cs
     文件        2745  2019-06-04 18:57  WindowsFormsApp1\WindowsFormsApp1\Form1.Designer.cs
     文件        5817  2019-06-04 18:57  WindowsFormsApp1\WindowsFormsApp1\Form1.resx
     目录           0  2019-06-04 14:21  WindowsFormsApp1\WindowsFormsApp1\obj\
     目录           0  2019-06-04 18:57  WindowsFormsApp1\WindowsFormsApp1\obj\Debug\
     文件        1431  2019-06-04 15:45  WindowsFormsApp1\WindowsFormsApp1\obj\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        7419  2019-06-04 14:32  WindowsFormsApp1\WindowsFormsApp1\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     文件           0  2019-06-04 14:21  WindowsFormsApp1\WindowsFormsApp1\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
     文件           0  2019-06-04 14:21  WindowsFormsApp1\WindowsFormsApp1\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
     文件           0  2019-06-04 14:21  WindowsFormsApp1\WindowsFormsApp1\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
     目录           0  2019-06-04 14:21  WindowsFormsApp1\WindowsFormsApp1\obj\Debug\TempPE\
     文件          42  2019-06-04 14:27  WindowsFormsApp1\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.CoreCompileInputs.cache
............此处省略19个文件信息

评论

共有 条评论