G
Guest
Hi,
I have a following code which I use to display the files in a directory
named Temp. If the Temp directory doesn’t have any files, then I want to
display a message but I don’t know how to find it out if the directory is
empty or has any files. Can some someone help me?
Thanks,
Joe
Dim strFilePath As String = "E:\Temp"
If Not Page.IsPostBack then
Dim dirInfo As New DirectoryInfo(strFilePath)
articleList.DataSource = dirInfo.GetFiles("*.*")
articleList.DataBind()
End If
I have a following code which I use to display the files in a directory
named Temp. If the Temp directory doesn’t have any files, then I want to
display a message but I don’t know how to find it out if the directory is
empty or has any files. Can some someone help me?
Thanks,
Joe
Dim strFilePath As String = "E:\Temp"
If Not Page.IsPostBack then
Dim dirInfo As New DirectoryInfo(strFilePath)
articleList.DataSource = dirInfo.GetFiles("*.*")
articleList.DataBind()
End If