26-02-18, 08:25 PM
(26-02-18, 07:50 PM)طالب برمجة كتب :PHP كود :
For i = 0 To Me.DataGridView1.Rows.Count - 1
Dim t As String = DataGridView1.Rows(i).Cells(10).Value
Dim fromDate As String = Regex.Match(t, "(?<=من\s).+?(?=\s)").Value
Dim toDate As String = Regex.Match(t, "(?<=الي\s).+?(?=\s)").Value
If IsDate(fromDate) And IsDate(toDate) Then
Dim d1 As Date = CDate(fromDate)
DataGridView1.Rows(i).Cells(7).Value = DateDiff("d", d1, Today)
Dim d2 As Date = CDate(toDate)
DataGridView1.Rows(i).Cells(8).Value = DateDiff("d", Today, d2)
Else
DataGridView1.Rows(i).Cells(7).Value = 0
DataGridView1.Rows(i).Cells(8).Value = 0
End If
If DataGridView1.Rows(i).Cells(10).Value Is Nothing Then
DataGridView1.Rows(i).Cells(7).Value = 0
DataGridView1.Rows(i).Cells(8).Value = 0
End If
Next
نعم هذا هو المطلوب
اسال اللّة ان ينعم عليك بالصحة والعافية وجميع العائلة وان يريك خيرا في أسرتك

