【问题标题】:VBNET Overload because no accessible 'int' accepts number argumentsVB NET 重载,因为没有可访问的“int”接受数字参数
【发布时间】:2013-10-03 08:05:38
【问题描述】:

我收到了这个 Visual Basic 2010 错误:重载解析失败,因为没有可访问的 int 接受数字参数。 第 2 行“int”处出错

Private Sub cmdadd_Click(sender As System.Object, e As System.EventArgs) Handles cmdadd.Click
    Dim i As Integer = Int.Parse(txtqfire.Text)
    i += 1
    txtqfire.Text = i.ToString()
End Sub

【问题讨论】:

    标签: vb.net button


    【解决方案1】:

    这不是 vb.net 吗?

    应该是:

    Integer.Parse(txtqfire.Text)
    

    你也可以使用:

    Int32.Parse(txtqfire.Text)
    

    【讨论】:

      【解决方案2】:

      VB.NET 中没有这样的方法(不像 c#)。

      VB.NET 转换为:

      Integer.Parse(txtqfire.Text)
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多