net use 命令就只好在局域网用,楼主可以在服务器上启用远程桌面功能,这样登录上去就可以重启了。

解决方案 »

  1.   

    远程桌面有时候 就卡死了。
    除了远程桌面 没有其他的办法么?
    还有:net use 只能 局域网使用啊?
    悲了个催 的
      

  2.   

    可以直接写一个C#的程序实现远程关机以及重启.参考代码
    ConnectionOptions options = new ConnectionOptions
                {
                    Username = this.textBox1.Text,
                    Password = this.textBox2.Text
                };
                ManagementScope scope = new ManagementScope(@"\\" + this.textBox3.Text + @"\root\cimv2", options);
                scope.Connect();
                ObjectQuery query = new ObjectQuery("SELECT * FROM Win32_OperatingSystem");
                ManagementObjectCollection objects = new ManagementObjectSearcher(scope, query).Get();
                foreach (ManagementObject obj2 in objects)
                {
                    if (this.radioButton1.Checked)
                    {
                        obj2.InvokeMethod("reboot", null);
                    }
                    else
                    {
                        obj2.InvokeMethod("ShutDown", null);
                    }
                }
      

  3.   

    其中 textBox3表示远程IP.
    1 2对应用户名以及密码.