作者fancies (N )
看板Visual_Basic
标题[.NET] 问一个vb.net的问题...
时间Sun Jun 19 19:32:47 2005
Dim m_intChoices As String() = New String() {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
Dim m_receive As Integer() = New Integer(9) {}
Sub DisplayHistogram()
Dim intRatings, intCounter As Integer
Dim strOutput As String
For intRatings = 1 To 10
For intCounter = 0 To m_receive(intCounter)
strOutput &= "*"
Next
strOutput &= ControlChars.CrLf
Next
End Sub ' DisplayHistogram
Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSubmit.Click
Dim intindex As Integer = 0
Dim strcboRate As String = Convert.ToString(cboRate.SelectedValue) '将
使用者选的值给变数
Dim intTotal As Integer
cboRate.DataSource = m_intChoices
For intindex = 0 To m_intChoices.GetUpperBound(0)
If strcboRate = m_intChoices(intindex) Then '跟原定的intChoice阵
列里面数字比
m_receive(intindex) += 1 '对的话在另一各Array 累加
End If
Next
DisplayHistogram()
End Sub
End Class ' FrmCafeteriaSurvey
为什麽我上面这行
Dim m_intChoices As String() = New String() {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
数子下面会有~ 然後说不允许integer 到string的隐含转换~~
谢谢~
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 221.169.15.183
1F:推 hamsters:在档案开头加上 Option Strict Off 140.114.217.31 06/20