VB - Remove single attribute from a file

By , 4/9/2008
(1 ratings)
With this function you can remove a single attribute from a file
Translate to C#
Public Sub RemoveAttribute(ByVal FileName As String, ByVal Remove As FileAttribute)
    Dim Attr As FileAttributes
    Attr = File.GetAttributes(FileName)
    File.SetAttributes(FileName, Attr And Not Remove)
End Sub

Tagged with attribute, file.

Comments

 

Log in, to comment!