O
-OSD-
Guest
Hi,
I am testing few files on local system and if it exists, showing results in text box as:
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If System.IO.File.Exists("D:\DemoDir\TextFile.txt") Then
RichTextBox1.Visible = True
Else
RichTextBox1.Visible = False
End If
If System.IO.File.Exists("D:\DemoDir\PDFFile.pdf") Then
RichTextBox2.Visible = True
Else
RichTextBox2.Visible = False
End If
If System.IO.File.Exists("D:\DemoDir\MSPPP.pptx") Then
RichTextBox3.Visible = True
Else
RichTextBox3.Visible = False
End If
If System.IO.File.Exists("D:\DemoDir\MSWordDoc.docx") Then
RichTextBox4.Visible = True
Else
RichTextBox4.Visible = False
End If
End Sub
End Class
When all files exists, I get following which is OK.

However, when the any file do not exists, here comes the output.

Which is not really optimized way I would say ,,, can we represent this result in table format something like this:?
File Name
Results
TextFile
Success
PDFFile
Fail
MSWordDoc
Fail
MSPPP
Success
Or any other suggested method?
Continue reading...
I am testing few files on local system and if it exists, showing results in text box as:
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If System.IO.File.Exists("D:\DemoDir\TextFile.txt") Then
RichTextBox1.Visible = True
Else
RichTextBox1.Visible = False
End If
If System.IO.File.Exists("D:\DemoDir\PDFFile.pdf") Then
RichTextBox2.Visible = True
Else
RichTextBox2.Visible = False
End If
If System.IO.File.Exists("D:\DemoDir\MSPPP.pptx") Then
RichTextBox3.Visible = True
Else
RichTextBox3.Visible = False
End If
If System.IO.File.Exists("D:\DemoDir\MSWordDoc.docx") Then
RichTextBox4.Visible = True
Else
RichTextBox4.Visible = False
End If
End Sub
End Class
When all files exists, I get following which is OK.

However, when the any file do not exists, here comes the output.

Which is not really optimized way I would say ,,, can we represent this result in table format something like this:?
File Name
Results
TextFile
Success
PDFFile
Fail
MSWordDoc
Fail
MSPPP
Success
Or any other suggested method?
Continue reading...