如何添加对Microsoft.VisualBasic.dll的引用? [英] How to add reference to Microsoft.VisualBasic.dll?

查看:94
本文介绍了如何添加对Microsoft.VisualBasic.dll的引用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

using Microsoft.VisualBasic;

Microsoft.VisualBasic.Interaction.InputBox("Favourite RPG?", "Game", "Cool!");

基本上,这是向用户询问他们最喜欢的RPG。然后,它显示默认值。我知道这是一个小例子,但我的程序无法运行,因为出现此错误:

So what this does is basically ask the user their favourite RPG. Then it displays the default value. I know this is a small example but my program will not run because I'm getting this error:

The type or namespace name 'Interaction' does not exist in the namespace 'Microsoft.VisualBasic' (are you missing an assembly reference?)

最初我发现了这个此处

推荐答案

您需要添加对 Microsoft.VisualBasic.dll

您拥有的using语句不是引用。这只是一个快捷方式,因此您不必每次要访问其中的成员时都输入完整的名称空间。

The using statement you have is not a reference. It's merely a shortcut so you don't have to type the full namespace every time you want to access a member inside it.

这篇关于如何添加对Microsoft.VisualBasic.dll的引用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆