显示当前系统时间锁频获得键盘直
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; namespace WindowsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { this.timer1.Start(); } private void timer1_Tick(object sender, EventArgs e) { this.toolStripStatusLabel1.Text = "当前系统时间是:" + System.DateTime.Now.ToLongTimeString(); } private void Form1_FormClosed(object sender, FormClosedEventArgs e) { this.timer1.Stop(); } private void pictureBox1_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { //建立进程 Process p = new Process(); p.StartInfo.WorkingDirectory = "c:\\windows\\system32"; p.StartInfo.FileName = "rundll32.exe"; //锁屏命令 p.StartInfo.Arguments = "user32.dll,LockWorkStation"; p.Start(); } else if (e.Button == MouseButtons.Right) { ProcessStartInfo psInfo = new ProcessStartInfo("cmd.exe"); psInfo.RedirectStandardInput = true; psInfo.UseShellExecute = false; psInfo.CreateNoWindow = true; psInfo.RedirectStandardOutput = true; Process proc = new Process(); proc.StartInfo = psInfo; proc.Start(); proc.StandardInput.WriteLine("shutdown -r"); } else { this.Close(); } } private void pictureBox1_Click(object sender, EventArgs e) { } private void Form1_KeyPress(object sender, KeyPressEventArgs e) { MessageBox.Show(Convert.ToInt32(e.KeyChar).ToString()); } private void statusStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e) { } } }
- 1
- 粉丝: 17
- 资源: 8
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 猫咪和汤58.apk
- 浏览器.apk
- 基于matlab实现是一个matlab中的power system 中搭建的一个模型
- 基于JSP毕业设计-教学管理系统(源代码+论文).zip
- 基于JSP毕业设计-家政管理系统-毕业设计.zip
- 基于Python实现淘宝商品评论采集(含逆向)源代码
- 基于matlab实现多目标进化算法NSGAⅡ&Matlab讲解.rar
- 基于matlab实现多车辆车辆路径问题,用遗传算法编程,保证可用.rar
- 基于matlab实现多层极限学习机实现手写体识别,准确率超过99%.rar
- 基于matlab实现电力系统最优潮流程序,可以应用于电力市场下的最优潮流计算 适合电力系统专业的同仁使用.rar
评论0