Check If Folder Exist Or Not Using VB.NET
Folder Checks Are Required During Verifying Installations & Updates , File Creations etc. We can check folder exist or not in VB.NET by importing System.IO namespace as we did in File check [Previous Post : Check If File Exist Or Not Using VB.NET ]
For Declaration :
Import System.IO
On Button Click, Form Load Etc ;
If Directory.Exists("MyFolder") Then
desired_action
Else
desired_action
End if
For Example , We are checking a folder named as "MyFolder" , The complete code is provided below:
Complete Code :
Image For Reference :
Post a Comment