vb.net 字符串连接,下面的代码执行后提示: 从字符串“ennum1&”到类型“Double”的转换无效。 请高手指点
Dim i As Random
i = New Random()
Dim ennum1 As Integer
Dim ennum2 As Integer
ennum1 = i.Next(1, 99).ToString
ennum2 = i.Next(1, 99).ToString
Label3.Text = "ennum1 & " * " & ennum2 & "=" "
该如何修改才能编译?
Label3.Text = "ennum1 & "乎哪神 * " & ennum2 & "=" "缓缓
改成:
Label3.Text =ennum1.tostring() & "*" & ennum2.tostring() & "="
就可以了,岁亏你试试!
Dim i As Random
i = New Random()
Dim ennum1 As Integer
Dim ennum2 As Integer
ennum1 = i.Next(1, 99).ToString
ennum2 = i.Next(1, 99).ToString
Label3.Text = ennum1 & " * " & ennum2 & " = "
Label3.Text = ennum1 & " * " & ennum2 & " = "