Torna al Thread
Imports System
Imports System.IO
Imports System.Text
Private Sub HideFolder_ShowFolder()
'Dim AppPath As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
Dim AppPath As String = "c:\"
Dim Path As String = AppPath & "\prov"
Dim attributes As FileAttributes
attributes = File.GetAttributes(Path)
If (attributes And FileAttributes.Hidden) = FileAttributes.Hidden Then
attributes = RemoveAttribute(attributes, FileAttributes.Hidden)
File.SetAttributes(Path, attributes)
Else
File.SetAttributes(Path, File.GetAttributes(Path) Or FileAttributes.Hidden)
End If
End Sub
Public Shared Function RemoveAttribute(ByVal attributes As FileAttributes, ByVal attributesToRemove As FileAttributes) As FileAttributes
Return attributes And (Not attributesToRemove)
End Function