什么代码是vb.net中的“int pos”?

时间:2013-12-03 18:41:13

标签: vb.net console int

vb.net中的“int pos”是什么代码?

需要有人翻译。

理解的,

4 个答案:

答案 0 :(得分:2)

C#

int pos;

等于:

VB.NET

Dim pos as Integer

答案 1 :(得分:0)

在VB.NET中很简单:

dim pos as integer

在C#中它是:

int pos;

答案 2 :(得分:0)

是正确的VB或vb.net如此声明变量,Dim a为整数。所以你需要将Dim pos作为整数。

答案 3 :(得分:0)

C#int关键字表示带符号的32位整数,解析为System.Int32结构。

与C#32位有符号整数相对应的VB.NET是Integer,您可以声明一个,如下所示:

Dim pos As Integer
  

注意:也可以使用System.Int32的.NET Framework结构,但很少这样做,因为有语言关键字可以解析这些结构,并且通常比System更具吸引力对应。

C#:

System.Int32 pos;

VB.NET:

Dim pos As System.Int32

对于整数类型,下面是C#和VB.NET如何支持它们的细分:

16位整数

  • short(C#)
  • Short(VB.NET)
  • System.Int16(.NET Framework)

32位整数

  • int(C#)
  • Integer(VB.NET)
  • System.Int32(.NET Framework)

64位整数

  • long(C#)
  • Long(VB.NET)
  • System.Int64(.NET Framework)