| 
 
	积分623贡献 精华在线时间 小时注册时间2011-12-18最后登录1970-1-1 
 | 
 
 发表于 2013-7-22 18:50:53
|
显示全部楼层 
| Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click 'VB.NET读取TXT文件数据保存为数组
 Dim f = My.Application.Info.DirectoryPath & "\" & "1.txt"
 Dim txt As IO.StreamReader = New IO.StreamReader(f, System.Text.Encoding.Default)
 Dim str(200) As String, n As Integer = 0
 Do Until txt.EndOfStream
 n = n + 1
 ReDim Preserve str(n) '数组从1开始
 str(n) = txt.ReadLine()
 Loop
 txt.Close()
 TextBox1.Text = Mid(str(3), 1, 1)
 End Sub
 | 
 |