Mega Code Archive

 
Categories / VB.Net Tutorial / Stream File
 

FileAttributes

public class Test    public Shared Sub Main         Dim lngAttributes As Long         lngAttributes = System.IO.File.GetAttributes("test.txt")         ' Use a binary AND to extract the specific attributes.         Console.WriteLine("Normal: " & CBool(lngAttributes And IO.FileAttributes.Normal))         Console.WriteLine("Hidden: " & CBool(lngAttributes And IO.FileAttributes.Hidden))         Console.WriteLine("ReadOnly: " & CBool(lngAttributes And IO.FileAttributes.ReadOnly))         Console.WriteLine("System: " & CBool(lngAttributes And IO.FileAttributes.System))         Console.WriteLine("Temporary File: " & CBool(lngAttributes And IO.FileAttributes.Temporary))         Console.WriteLine("Archive: " & CBool(lngAttributes And IO.FileAttributes.Archive))    End Sub End Class Normal: False Hidden: False ReadOnly: False System: False Temporary File: False Archive: True