通过 NuGet 安装 InputSimulator,没有成员可访问

Installed InputSimulator via NuGet, no members accessible(通过 NuGet 安装 InputSimulator,没有成员可访问)
本文介绍了通过 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,没有成员可访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

DispatcherQueue null when trying to update Ui property in ViewModel(尝试更新ViewModel中的Ui属性时DispatcherQueue为空)
Drawing over all windows on multiple monitors(在多个监视器上绘制所有窗口)
Programmatically show the desktop(以编程方式显示桌面)
c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
LINQ many-to-many relationship, how to write a correct WHERE clause?(LINQ多对多关系,如何写一个正确的WHERE子句?)