Dim lblgrid As Label = CType(e.Row.FindControl("lblgrid"), Label)
If NOT ISNoting(lblgrid)Then
lblgrid.Text = e.Row.DataItem("gr_id")
Dim lblfile As Label = CType(e.Row.FindControl("lblfile"), Label)
'แสดงชื่อไฟล์ทั้งหมดใน Folder File_Project
Dim myDirInfo As DirectoryInfo
Dim arrFileInfo As Array
Dim myFileInfo As FileInfo
myDirInfo = New DirectoryInfo("D:/File_Project")
arrFileInfo = myDirInfo.GetFiles("*.*")
For Each myFileInfo In arrFileInfo
Me.lbllistfile.Text = Me.lbllistfile.Text & myFileInfo.Name.Substring(0, 8)
If lblgrid.Text = Me.lbllistfile.Text Then
lblfile.Text = "มีเอกสาร"
lblfile.ForeColor = Drawing.Color.Green
Else
lblfile.Text = "ไม่มีเอกสาร"
lblfile.ForeColor = Drawing.Color.Red
End If
Next myFileInfo
myDirInfo = Nothing
End If
Dim lblgrid As Label = CType(e.Row.FindControl("lblgrid"), Label)
If NOT ISNoting(lblgrid)Then
lblgrid.Text = e.Row.DataItem("gr_id")
Dim lblfile As Label = CType(e.Row.FindControl("lblfile"), Label)
'แสดงชื่อไฟล์ทั้งหมดใน Folder File_Project
Dim myDirInfo As DirectoryInfo
Dim arrFileInfo As Array
Dim myFileInfo As FileInfo
myDirInfo = New DirectoryInfo("D:/File_Project")
arrFileInfo = myDirInfo.GetFiles("*.*")
Dim bFlag AS Boolean = False
For Each myFileInfo In arrFileInfo
Me.lbllistfile.Text = Me.lbllistfile.Text & myFileInfo.Name.Substring(0, 8)
If lblgrid.Text = Me.lbllistfile.Text Then
Boolean = True
End If
Next myFileInfo
myDirInfo = Nothing
End If
IF Boolean = True Then
lblfile.Text = "มีเอกสาร"
lblfile.ForeColor = Drawing.Color.Green
Else
lblfile.Text = "ไม่มีเอกสาร"
lblfile.ForeColor = Drawing.Color.Red
End IF