有没有一种方法可以防止远程桌面锁定?

时间:2019-09-27 13:43:43

标签: c#

我正在c#应用程序中使用AxMsRdpClient8NotSafeForScripting连接到远程服务器。现在,我要防止远程桌面锁定。

有什么方法可以实现这一目标?

编辑:

在我的系统中,为防止其锁定(因为无法更改设置),我使用了MouseJiggle应用程序,该应用程序基本上将鼠标移动重复发送到系统中

public static class Jiggler
{

  internal const int INPUT_MOUSE = 0;
  internal const int MOUSEEVENTF_MOVE = 1;

  [DllImport("user32.dll", SetLastError = true)]
  private static extern uint SendInput(uint nInputs, ref INPUT pInputs, int cbSize);

  public static void Jiggle(int dx, int dy)
  {
    if (Jiggler.SendInput(1U, ref new INPUT()
    {
      TYPE = 0,
      dx = dx,
      dy = dy,
      mouseData = 0,
      dwFlags = 1,
      time = 0,
      dwExtraInfo = (IntPtr) 0
    }, 28) != 1U)

      throw new Win32Exception();
  }
}

我可以将这些鼠标移动发送到远程服务器吗?

谢谢。

0 个答案:

没有答案