vb 索引超出了数组界限 急啊
PublicClassForm1PublicFilenameAsString="英汉小词典.txt"PublicMyword(6500,1)AsStringPublicw...
Public Class Form1
Public Filename As String = "英汉小词典.txt"
Public Myword(6500, 1) As String
Public words As Integer = 0
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim main As String
Dim chang As Integer
Dim i As Integer = 0
Dim n As String
Dim m As String
Dim stringchang As Integer
TextBox1.Text = ""
TextBox2.Text = ""
FileOpen(1, "F:\课程设计\英汉小词典.txt", OpenMode.Input)
Do While Not EOF(1)
main = LineInput(1)
chang = InStr(main, " ")
n = Microsoft.VisualBasic.Left(main, chang - 1)
Myword(i, 0) = n
ListBox1.Items.Add(n)
stringchang = Len(main) - chang
m = Trim(Microsoft.VisualBasic.Right(main, stringchang))
Myword(i, 1) = m
i = i + 1
Loop
words = i
FileClose(1)
End Sub
End Class
Myword(i, 0) = n 这里 展开
Public Filename As String = "英汉小词典.txt"
Public Myword(6500, 1) As String
Public words As Integer = 0
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim main As String
Dim chang As Integer
Dim i As Integer = 0
Dim n As String
Dim m As String
Dim stringchang As Integer
TextBox1.Text = ""
TextBox2.Text = ""
FileOpen(1, "F:\课程设计\英汉小词典.txt", OpenMode.Input)
Do While Not EOF(1)
main = LineInput(1)
chang = InStr(main, " ")
n = Microsoft.VisualBasic.Left(main, chang - 1)
Myword(i, 0) = n
ListBox1.Items.Add(n)
stringchang = Len(main) - chang
m = Trim(Microsoft.VisualBasic.Right(main, stringchang))
Myword(i, 1) = m
i = i + 1
Loop
words = i
FileClose(1)
End Sub
End Class
Myword(i, 0) = n 这里 展开
若以下回答无法解决问题,邀请你更新回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询