Installed InputSimulator via NuGet, no members accessible(通过 NuGet 安装 InputSimulator,没有成员可访问)
问题描述
在 Visual Studio 2013 中,我安装了一个名为InputSimulator"的 C# 包.这样做之后,我看到一个名为WindowsInput"的新引用被添加到我的项目中.(即 WindowsInput.dll)
In Visual Studio 2013, I installed a C# package called "InputSimulator." After doing so, I see a new reference get added to my project called "WindowsInput." (i.e., WindowsInput.dll)
问题在于,codeplex 网站谈到的所有方法都无法访问.如果我尝试:
The problem is that none of the methods that the codeplex site talks about are accessible. If I try:
InputSimulator.SimulateTextEntry("Say hello!");
我得到错误:
Error 14 'WindowsInput.InputSimulator' does not contain a definition for
'SimulateTextEntry' Blah.cs 33 32 ALibrary
我确实有 using WindowsInput
作为指令.
I do have using WindowsInput
as a directive.
有谁知道为什么这些方法无法访问?SimulateKeyPress()
等方法也不可用.这些是关键 API.我是否缺少有关添加此库和引用它的内容?
Does anyone know why the methods are not accessible? Methods like SimulateKeyPress()
are also not available. These are the key API. Am I missing something about adding this library and referencing it?
推荐答案
所以我只是尝试了这个lib.实际上,他们的文档只是有点偏离.你需要先创建一个 InputSimulator 的实例,像这样:
So I just tried this lib. Actually their documentation is just a little off. You need to create an instance of InputSimulator first, like this:
InputSimulator s = new InputSimulator();
s.Keyboard.TextEntry("Hello sim !");
这篇关于通过 NuGet 安装 InputSimulator,没有成员可访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:通过 NuGet 安装 InputSimulator,没有成员可访问


基础教程推荐
- 将 XML 转换为通用列表 2022-01-01
- c# Math.Sqrt 实现 2022-01-01
- rabbitmq 的 REST API 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- SSE 浮点算术是否可重现? 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- 如何激活MC67中的红灯 2022-01-01