简体   繁体   English

VB.NET项目属性命名空间vs Imports语句?

[英]VB.NET project properties namespaces vs Imports statement?

在VB.NET项目中,在Project-Properties中导入命名空间和在文件开头使用Imports [NameSpace]语句之间有什么区别?

Imports in the project properties apply to all code files. 项目属性中的导入适用于所有代码文件。

The Imports directive only applies to the class it is declared in. Imports指令仅适用于声明它的类。

From How to: Add or Remove Imported Namespaces (Visual Basic) on MSDN: 如何:在MSDN上添加或删除导入的命名空间(Visual Basic)

Imported namespaces are managed on the References page of the Project Designer. 导入的命名空间在Project Designer的“引用”页面上进行管理。 The imports you specify in this dialog box are passed directly to the compiler (/imports) and apply to all files in your project. 您在此对话框中指定的导入将直接传递给编译器(/ imports)并应用于项目中的所有文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM