找传奇、传世资源到传世资源站!

定时强制锁屏休息程序源码下载(C#)

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

每到半点的时候强制提示休息,过后自动恢复
from clipboard
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using Microsoft.Win32;using System.Diagnostics;using System.Runtime.InteropServices;using System.Threading;namespace WinLockScreen{ public partial class Form1 : Form { #region 变量 Random Random1 = new Random(); #endregion public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { this.Hide(); btnClose.Hide(); lblInfo1.Text = "Width:" this.Width.ToString(); lblInfo2.Text = "Height:" this.Height.ToString(); lblInfo3.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); //lblInfo1.Text = this.Width.ToString(); SetTopMost(); btnClose.Location = new Point(this.Width - 150, this.Height - 50); } private void Form1_FormClosing(object sender, FormClosingEventArgs e) { e.Cancel = true; } private void btnClose_Click(object sender, EventArgs e) { this.Hide(); } private void timer1_Tick(object sender, EventArgs e) { if (DateTime.Now.Minute % 30 != 0) //if (DateTime.Now.Second % 20 < 10) { this.Hide(); } else { this.Show(); SetTopMost(); lblInfo3.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); SetLblTipMessageChange(); } } /// <summary> /// 设置窗体为最前显示 /// </summary> void SetTopMost() { this.TopMost = false; this.TopMost = true; } /// <summary> /// 改变提示信息位置 /// </summary> void SetLblTipMessageChange() { int width = this.Width - Random1.Next(this.Width - lblTipMessage.Width); int height = this.Height - Random1.Next(this.Height - lblTipMessage.Height); lblTipMessage.Location = new Point(width, height); } private void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.Modifiers == Keys.Alt && e.KeyCode == Keys.F4) { e.Handled = true; } } private void btnCloseTaskmgr_Click(object sender, EventArgs e) { } }}

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复