资源简介
.net版本实现远程控制关闭与重启计算机实例源码

代码片段和文件信息
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 System.Data.OleDb;
using System.Management;
namespace CRRemoteComputer
{
public partial class Frm_Main : Form
{
public Frm_Main()
{
InitializeComponent();
}
private void button1_Click(object sender EventArgs e)
{
CloseComputer(“Shutdown“);//远程关闭计算机
}
private void button2_Click(object sender EventArgs e)
{
CloseComputer(“Reboot“);//远程重启计算机
}
private void textBox1_KeyPress(object sender KeyPressEventArgs e)
{
if (e.KeyChar == 13 && textBox1.Text != ““)
textBox2.Focus();
}
private void textBox2_KeyPress(object sender KeyPressEventArgs e)
{
if (e.KeyChar == 13 && textBox2.Text != ““)
button1.Focus();
}
private void FrmMain_FormClosed(object sender FormClosedEventArgs e)
{
Application.Exit();
}
#region 关闭或重启远程计算机
///
/// 关闭或重启远程计算机
///
/// 要执行的操作命令
private void CloseComputer(string doinfo)
{
ConnectionOptions op = new ConnectionOptions();//创建ConnectionOptions对象
op.Username = textBox4.Text;//设置远程机器用户名
op.Password = textBox3.Text;//设置远程机器登录密码
//创建ManagementScope对象
ManagementScope scope = new ManagementScope(“\\\\“ + textBox2.Text + “\\root\\cimv2:Win32_Service“ op);
try
{
scope.Connect();//连接远程对象
objectQuery oq = new objectQuery(“SELECT * FROM Win32_OperatingSystem“);//实例化objectQuery对象
//创建ManagementobjectSearcher对象
ManagementobjectSearcher query1 = new ManagementobjectSearcher(scope oq);
ManagementobjectCollection queryCollection1 = query1.Get();//得到WMI控制
foreach (Managementobject mobj in queryCollection1)
{
string[] str = { ““ };
mobj.InvokeMethod(doinfo str);
}
}
catch (Exception ey)
{
MessageBox.Show(ey.Message);
}
}
#endregion
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 0 2019-04-14 13:10 .net版本实现远程控制关闭与重启计算机实例源码\1.bmp
文件 161 2018-12-26 16:15 .net版本实现远程控制关闭与重启计算机实例源码\app.config
文件 12800 2019-02-15 09:46 .net版本实现远程控制关闭与重启计算机实例源码\bin\Debug\CRRemoteComputer.exe
文件 161 2018-12-26 16:15 .net版本实现远程控制关闭与重启计算机实例源码\bin\Debug\CRRemoteComputer.exe.config
文件 36352 2019-02-15 09:46 .net版本实现远程控制关闭与重启计算机实例源码\bin\Debug\CRRemoteComputer.pdb
文件 14328 2010-08-26 13:54 .net版本实现远程控制关闭与重启计算机实例源码\bin\Debug\CRRemoteComputer.vshost.exe
文件 490 2009-06-11 05:14 .net版本实现远程控制关闭与重启计算机实例源码\bin\Debug\CRRemoteComputer.vshost.exe.manifest
文件 4192 2018-12-26 16:15 .net版本实现远程控制关闭与重启计算机实例源码\CRRemoteComputer.csproj
文件 1000 2018-12-26 16:17 .net版本实现远程控制关闭与重启计算机实例源码\CRRemoteComputer.sln
..A..H. 33280 2019-02-15 09:47 .net版本实现远程控制关闭与重启计算机实例源码\CRRemoteComputer.v12.suo
文件 2717 2019-02-15 09:46 .net版本实现远程控制关闭与重启计算机实例源码\Frm_Main.cs
文件 9429 2019-02-15 09:46 .net版本实现远程控制关闭与重启计算机实例源码\Frm_Main.designer.cs
文件 5814 2019-02-15 09:46 .net版本实现远程控制关闭与重启计算机实例源码\Frm_Main.resx
文件 42 2018-12-05 16:43 .net版本实现远程控制关闭与重启计算机实例源码\obj\Debug\CRRemoteComputer.csproj.CoreCompileInputs.cache
文件 5467 2019-02-15 09:46 .net版本实现远程控制关闭与重启计算机实例源码\obj\Debug\CRRemoteComputer.csproj.FileListAbsolute.txt
文件 980 2019-02-15 09:46 .net版本实现远程控制关闭与重启计算机实例源码\obj\Debug\CRRemoteComputer.csproj.GenerateResource.Cache
文件 10886 2018-12-05 16:43 .net版本实现远程控制关闭与重启计算机实例源码\obj\Debug\CRRemoteComputer.csprojAssemblyReference.cache
文件 2212 2018-12-26 16:15 .net版本实现远程控制关闭与重启计算机实例源码\obj\Debug\CRRemoteComputer.csprojResolveAssemblyReference.cache
文件 12800 2019-02-15 09:46 .net版本实现远程控制关闭与重启计算机实例源码\obj\Debug\CRRemoteComputer.exe
文件 180 2019-02-15 09:46 .net版本实现远程控制关闭与重启计算机实例源码\obj\Debug\CRRemoteComputer.Frm_Main.resources
文件 36352 2019-02-15 09:46 .net版本实现远程控制关闭与重启计算机实例源码\obj\Debug\CRRemoteComputer.pdb
文件 180 2018-12-26 16:15 .net版本实现远程控制关闭与重启计算机实例源码\obj\Debug\CRRemoteComputer.Properties.Resources.resources
文件 865 2019-02-15 09:45 .net版本实现远程控制关闭与重启计算机实例源码\obj\Debug\DesignTimeResolveAssemblyReferences.cache
文件 7004 2019-02-15 09:45 .net版本实现远程控制关闭与重启计算机实例源码\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 0 2018-12-05 16:43 .net版本实现远程控制关闭与重启计算机实例源码\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
文件 0 2018-12-05 16:43 .net版本实现远程控制关闭与重启计算机实例源码\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
文件 0 2018-12-05 16:43 .net版本实现远程控制关闭与重启计算机实例源码\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
文件 4608 2019-02-15 09:45 .net版本实现远程控制关闭与重启计算机实例源码\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll
文件 500 2010-08-26 13:59 .net版本实现远程控制关闭与重启计算机实例源码\Program.cs
文件 1364 2010-08-26 13:54 .net版本实现远程控制关闭与重启计算机实例源码\Properties\AssemblyInfo.cs
............此处省略16个文件信息
- 上一篇:各种贴片元件IC封装库.rar
- 下一篇:shamir 秘密共享算法
相关资源
- WPF USB 网络 串口 通信软件
- B/S 网上订餐系统
- 教室管理系统.rar
- 小鸡快跑游戏.
-
分别适用于.NET fr
amework 2.0和4.0的E - 汽车租赁系统............................
- 德卡D8读写器关于读写感应卡的一些代
- halcon 测量助手
- 图片存储到数据库保存二进制文件并
- 用Socket写的简易FTP服务器和客户端
- 企业销售管理信息系统(全套)
- 串口操作类(justinio)
- 基于Petri网的工作流(完整的原创源代
- 选择题自动考试系统
- 多线程实例:桌面智能弹球小游戏
- 土地信息管理系统
- ServiceStack V3.9 全部dll
- PDF pdfview.ocx 无水印
- 无需共享打印机实现远程打印功能小
- 真正的破解版PDFView4NET
- 网页调用ActiveX控件获取串口数据
- Luence的与盘古分词的使用软件
- Emgu.CV 打开视频与人脸检测
- 麦克纳姆轮程序.rar
- Unity3D 实战视频教程 保卫萝卜 2D 游戏
- net微信支付
- lucene.net+盘古分词多条件全文检索并匹
- 闪电猫-电商下图助手5.0.zip
- FastReport.Net V2014.4.8 For .Net2.0
- NET Reflector 8.3破解版自带代码导出
评论
共有 条评论