Hide Folder in VB.NET

Today, I will teach you how to create a program that can hide folder in VB.NET. Now, let's start this tutorial! 1. Let's start with creating a Windows Form Application for this tutorial by following the following steps in Microsoft Visual Studio: Go to File, click New Project, and choose Windows Application. 2. Next, add only one Button named Button1 and labeled it as "Browse Folder to Hide" and FolderBrowserDialog named as FolderBrowserDialog1 for browsing a folder. You must design your interface like this: output 3. Next, we will code for clicking the Button. Here's the code:
  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2. Dim FolderToHide As String
  3. If FolderBrowserDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
  4. 'Choose the Folder To Hide
  5. FolderToHide = FolderBrowserDialog1.SelectedPath.TrimEnd
  6.  
  7. Dim ToHideDir As New System.IO.DirectoryInfo(FolderToHide)
  8. 'Then Change the Attribute To Hidden Which will Hide the Folder
  9. ToHideDir.Attributes = IO.FileAttributes.Hidden
  10. End If
  11. End Sub
As you can see the above code, we only trigger to use the IO.FileAttributes.Hidden to hide the folder to its directory. Choose any folder from your pc then it will hide it. For more inquiries and need programmer for your thesis systems in any kind of programming languages, just contact my number below. Best Regards, Engr. Lyndon Bermoy IT Instructor/System Developer/Android Developer/Freelance Programmer Mobile: 09488225971 Landline: 826-9296 E-mail:[email protected] Add and Follow me on Facebook: https://www.facebook.com/donzzsky Visit and like my page on Facebook at: https://www.facebook.com/BermzISware

Add new comment