27-11-19, 02:30 PM
(27-11-19, 01:38 PM)CrazyMe كتب :كود :
Dim age() As String
Dim thename() As String
Dim mytext As String
Dim lines() As String
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
mytext = My.Computer.FileSystem.ReadAllText("d:\s.txt")
Dim seps() As Char = {vbNewLine}
lines = mytext.Split(seps)
Static i As Integer
For Each line As String In lines
ReDim Preserve age(i)
ReDim Preserve thename(i)
age(i) = line.Substring(line.IndexOf(":") + 1, line.IndexOf("_") - line.IndexOf(":") + 1)
thename(i) = line.Substring(line.LastIndexOf(":") + 1)
DataGridView1.Rows.Add(age(i).Remove(age(i).IndexOf("_")))
DataGridView1.Rows(i).Cells(1).Value = thename(i)
i += 1
Next
هو اولا تسلم ايد ثانيا انا متفائل انه هيكون فيه حل ثالثا جاب هذا الخطاء

