VB.NET与C#"var"关键字等效吗?

问题描述:

例如如何使VB.NET 静态键入一个局部变量,使其成为赋值右侧的表达式的 static 类型?

E.g. how do I get VB.NET to statically type a local variable to be the static type of the expression on the right had side of the assignment?

像这样:

Dim myVar = 3

Dim myVar = 3

您还需要

选项推断为

(在文件顶部或在项目设置中)

(At the top of the file or in project settings)

请参见"本地类型推断"