标题:c#dos命令关机重启注销代码求译
只看楼主
米格的矫情
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2012-10-22
 问题点数:0 回复次数:0 
c#dos命令关机重启注销代码求译
using System;
using System.Collections.Generic;
using
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;//此名字间是用来干嘛使得?
using System.Diagnostics;//此名字间是用来干嘛使得?


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

        private void btnguanji_Click(object sender, EventArgs e)
        {
            try
            {
                Process.Start("Shutdown.exe", "-s -t 0");//Process.Start是什麽?
            }
            catch (Exception ex)//Exception ex是什麽?
            {
                MessageBox.Show(ex.Message);//这个是什麽?
            }
        }

        private void btnchongqi_Click(object sender, EventArgs e)
        {
            try
            {
                Process.Start("shutdown.exe", " -r -t 0");

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
         [DllImport("user32.dll", EntryPoint = "ExitWindowsEx", CharSet = CharSet.Ansi)]//这个是什麽?
        private static extern int ExitWindowsEx(int uFlags, int dwReserved);//这个是什麽?

         private void btnzhuxiao_Click(object sender, EventArgs e)
         {
             ExitWindowsEx(0, 0);//这个是什麽?


         }

         private void btnzidongguanji_Click(object sender, EventArgs e)
         {
             Process.Start("Shutdown.exe -s -t 3600");
         }

    }
}

望高手们给力相助!小女子无以为报!
搜索更多相关主题的帖子: 注销 private public 
2012-10-22 10:39



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-383782-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.217664 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved