vb.net---如何用二维数组逐个逐个地把TEXTBOX文本框里面的数字读取

前端之家收集整理的这篇文章主要介绍了vb.net---如何用二维数组逐个逐个地把TEXTBOX文本框里面的数字读取前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
就是在在TEXTBox中有数字如下: 0 1 1 0 1 0
1 1 0 0 1 0
1 1 1 1 1 1
0 0 0 1 0 1
那如何用二维数组A(,)进行逐个地读取上面文本框里面的数字呢?比如,A(0,0)=0;A(0,1)=1;A(0,2)=1;A(0,3)=0
------------------------------------------------------------------------------------------------------------------------------------------------
Dim arry1(,) As String        
Dim arry2() As String        
Dim I As Integer,j As Integer        
Dim intTmp1 As Integer,intTmp2 As Integer        
intTmp1 = TextBox1.Lines.GetUpperBound(0)        
arry2 = Split(Trim(TextBox1.Lines(0))," ")        
intTmp2 = arry2.GetUpperBound(0)        
ReDim Preserve arry1(intTmp1,intTmp2)        
For I = 0 To intTmp1            
arry2 = Split(Trim(TextBox1.Lines(I))," ")            
For j = 0 To intTmp2                
arry1(I,j) = arry2(j)            
Next        
Next

猜你在找的VB相关文章