这个问题可能和Windows Server的权限有关,因为AutoItX.Send使用了Windows API来模拟按键输入。为了解决这个问题,可以尝试使用SendKeys.Send()方法来发送按键,因为它是使用.NET框架内置的方法来模拟按键输入,而不是使用WindowsAPI。以下是一个示例代码:
using System.Windows.Forms;
// ...
// 在代码中进行 Windows Server 的远程连接
// ...
// 将焦点放到文本字段上以便发送按键
someTextField.Focus();
// 发送按键
SendKeys.Send("Some keys to be sent to the text field.");
此代码示例假定你已经在C#中连接上了远程Windows Server。如果你还没有连接,则需要使用Remote Desktop等工具远程连接到Windows Server。