Set file attributes: Hidden, ReadOnly : FileInfo « Stream File « VB.Net Tutorial






Public Class Tester
    Public Shared Sub Main
    
        Dim fileDetail As IO.FileInfo = My.Computer.FileSystem.GetFileInfo("yourfile.jpg")
        fileDetail.IsReadOnly = True
        fileDetail.Attributes = fileDetail.Attributes Or IO.FileAttributes.Hidden
    End Sub

End Class








13.4.FileInfo
13.4.1.My.Computer.FileSystem.GetFileInfo(''File Name'')
13.4.2.FileInfo.IsReadOnly, FileAttributes.Hidden
13.4.3.Set file attributes: Hidden, ReadOnly
13.4.4.Get File Attributes as a string
13.4.5.Get file Creation Time, Last Access Time and Modified Time
13.4.6.Get file size
13.4.7.Get file extension name