希望人们能提供帮助!
我正在尝试创建一个组合框,其中填充了来自使用 , 作为断点分隔的文本文件中的信息。IE
objecta,grad,N,words,5,moretext
我需要 , 之间的各个区域作为整数/布尔值/字符串 .. 但我在让代码正常工作时遇到问题
我在网上搜索过,找到了这段代码,但它对我来说不能正常工作。也许我很愚蠢,但希望有人可以帮助我。帮助我哦,互联网大师!
Public Sub meritlist()
Dim looksups As New ArrayList
' This call is required by the Windows Form Designer.
InitializeComponent()
Dim rdr As IO.StreamReader = IO.File.OpenText(c:merits.txt")
While Not rdr.EndOfStream
Dim line As String = rdr.ReadLine()
'Split the line by a comma:
Dim arrayList = line.Split(",")
'Get the right values: break down is as: Merit Name,Type,Shared,Carthan,Max,Pre-Req
Dim meritname As Integer = arrayList(0)
Dim merittype As String = arrayList(1)
Dim meritshared As Boolean = arrayList(2)
Dim carthan As String = arrayList(3)
Dim meritmax As Integer = arrayList(4)
Dim prereq As String = arrayList(5)
cmoMRDro.Items.Add(New lookups(arrayList(0), arrayList(1)))
End While
rdr.Close()
End Sub