【问题标题】:how to use this command in c# shutdown -s -f -t 30 -m \\ip address如何在c#中使用此命令shutdown -s -f -t 30 -m \\ip address
【发布时间】:2015-09-24 15:38:29
【问题描述】:

如何使用 C# 关闭远程计算机,我尝试在命令提示符下执行它,但它工作正常,但是当我尝试将它集成到我的 c# 代码时,我收到错误 targetInvocationException 未处理

程序.cs

Application.SetCompatibleTextRenderingDefault(false);

Application.Run(new Form1());

-这是错误所在

form1.cs

System.Diagnostics.Process.Start("shutdown -s -f -t 60 -m\\192.168.23.18");

这是我想要使用的代码行

【问题讨论】:

    标签: c#-4.0


    【解决方案1】:

    您是否尝试过 StackOverflow 上类似问题的解决方案?

    1. Using Process.Start
    2. Another using Process
    3. Using WMI

    【讨论】:

      猜你喜欢
      • 2018-05-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多