Dim doubleArray As Double() = File.ReadLines("D:\example.txt").SelectMany(Function(s) s.Split(ControlChars.Tab).Skip(2).Take(2).Select(AddressOf Convert.ToDouble).ToArray()).ToArray()
Public Class Form2 Private data As Double() = {} Public Sub LoadValues(d As Double()) data = d ListBox1.DataSource = data End Sub End Class
Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim 配列1 As Double() = {100R, 200.0, 100.0#, 200} Dim f As New Form2() f.LoadValues(配列1) f.Show(Me) End Sub Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click Dim 配列1 As Double() = {10.0R, 20.0, 10.0#, 20} Using f As New Form2() f.LoadValues(配列1) f.ShowDialog(Me) End Using End Sub End Class