Skip to main content

How to Hide File using VB.Net

Private Sub HideFile(ByVal strFilePath As String)

 Try
    Dim strFInfo As New FileInfo(strFilePath)
    strFInfo.Attributes = FileAttributes.Hidden
    MessageBox.Show("Successfully Applied.")
 Catch ex As Exception
    MessageBox.Show(ex.Message)
 End Try

End Sub