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,没有成员可访问


基础教程推荐
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01