日本好好热aⅴ|国产99视频精品免费观看|日本成人aV在线|久热香蕉国产在线

  • <cite id="ikgdy"><table id="ikgdy"></table></cite>
    1. 西西軟件園多重安全檢測(cè)下載網(wǎng)站、值得信賴的軟件下載站!
      軟件
      軟件
      文章
      搜索

      首頁編程開發(fā)其它知識(shí) → 電腦鎖定、注銷、關(guān)機(jī) C#代碼實(shí)現(xiàn)

      電腦鎖定、注銷、關(guān)機(jī) C#代碼實(shí)現(xiàn)

      相關(guān)軟件相關(guān)文章發(fā)表評(píng)論 來源:本站整理時(shí)間:2010/11/29 8:55:54字體大。A-A+

      作者:佚名點(diǎn)擊:491次評(píng)論:0次標(biāo)簽: 注銷 關(guān)機(jī) 電腦鎖定

      • 類型:手游電腦版大。26.1M語言:中文 評(píng)分:4.2
      • 標(biāo)簽:
      立即下載

      c#讓電腦鎖定、注銷、關(guān)機(jī)
      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.Runtime.InteropServices;
      using System.IO;
      using System.Threading;
      using System.Diagnostics;
      //using System.Configuration;
      //using System.Xml ;

      ——————————————————————————————————————————————

      // 鎖定計(jì)算機(jī).
      [DllImport("user32.dll")]
      private static extern void LockWorkStation();//須寫extern
      private void button1_Click(object sender, EventArgs e)
      {
      LockWorkStation();
      }
      //注銷計(jì)算機(jī)
      [DllImport("user32.dll", EntryPoint = "ExitWindowsEx", CharSet = CharSet.Ansi)]
      private static extern int ExitWindowsEx(int a,int b);
      private void button1_Click(object sender, EventArgs e)
      {
      ExitWindowsEx(0, 0);
      }
      //關(guān)閉計(jì)算機(jī).
      private void button3_Click(object sender, EventArgs e)
      {
      System.Diagnostics.Process mp = new System.Diagnostics.Process();
      mp.StartInfo.FileName = "cmd.exe";
      mp.StartInfo.RedirectStandardInput = true;
      mp.StartInfo.RedirectStandardOutput = true;
      mp.StartInfo.RedirectStandardError = true;
      mp.StartInfo.UseShellExecute = false;
      mp.StartInfo.CreateNoWindow = true;
      mp.Start();//啟動(dòng)進(jìn)程
      mp.StandardInput.WriteLine("shutdown -s -t 0");//關(guān)機(jī)
      }
      //重啟計(jì)算機(jī)
      private void button3_Click(object sender, EventArgs e)
      {
      System.Diagnostics.Process mp = new System.Diagnostics.Process();
      mp.StartInfo.FileName = "cmd.exe";
      mp.StartInfo.RedirectStandardInput = true;
      mp.StartInfo.RedirectStandardOutput = true;
      mp.StartInfo.RedirectStandardError = true;
      mp.StartInfo.UseShellExecute = false;
      mp.StartInfo.CreateNoWindow = true;
      mp.Start();//啟動(dòng)進(jìn)程
      mp.StandardInput.WriteLine("shutdown -r -t 0");//重啟
      }

      LinkDataBase link=new LinkDataBase();string tempTableName="用戶清單";this.ds=link.SelectDataBase(tempStrSQL,tempTableName);this.myTable=ds.Tables[0];你把這個(gè)寫到那個(gè)單擊事件中試試?

        相關(guān)評(píng)論

        閱讀本文后您有什么感想? 已有人給出評(píng)價(jià)!

        • 8 喜歡喜歡
        • 3 頂
        • 1 難過難過
        • 5 囧
        • 3 圍觀圍觀
        • 2 無聊無聊

        熱門評(píng)論

        最新評(píng)論

        發(fā)表評(píng)論 查看所有評(píng)論(0)

        昵稱:
        表情: 高興 可 汗 我不要 害羞 好 下下下 送花 屎 親親
        字?jǐn)?shù): 0/500 (您的評(píng)論需要經(jīng)過審核才能顯示)