http://search.csdn.net/Expert/topic/2542/2542604.xml?temp=.6864282
解决方案 »
- C# tabcontrol怎么用啊?
- 几个菜鸟问题
- WINFORM 怎么添加 XML节点
- 自定义颜色与系统已定义的颜色
- C# web 页面上 做一个播放视频文件的进度条??
- 求助C#应用程序窗体返回值的问题
- winfrom中的datagrid中如何定位到某个单元格所在的行?
- 我在黑暗中苦苦摸索、学习的时候,请兄弟们给一点支持~
- 急!c#死锁问题
- 如何用DataSet更形数据库?
- .net+oracle: Specified argument was out of the range of valid values
- 怎样使用.NET Framework 工具(在Visual Studio.NET)
using System.Management;
.................ConnectionOptions co = new ConnectionOptions();
co.Username = "";//用户名
co.Password = "";//密码
string ls_tmp = MachineNameText.Text;
System.Management.ManagementScope ms = new System.Management.ManagementScope("\\\\" + ls_tmp + "\\root\\cimv2", co);
System.Management.ObjectQuery oq = new System.Management.ObjectQuery("SELECT * FROM Win32_OperatingSystem");
ManagementObjectSearcher query = new ManagementObjectSearcher(ms,oq);
ManagementObjectCollection queryCollection = query.Get();
foreach( ManagementObject mo in queryCollection )
{
string[] ss={""};
mo.InvokeMethod("ShutDown",ss);
}