通过NuGet安装了InputSimulator,没有成员可访问 [英] Installed InputSimulator via NuGet, no members accessible
问题描述
在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
作为指令.
有人知道为什么无法访问这些方法吗?诸如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,没有成员可访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!