View Single Post
 
Old March 21st, 2006, 09:59 PM
Thearon's Avatar
Thearon Thearon is offline
Wrox Author
 
Join Date: Dec 2003
Location: Fuquay Varina, NC, USA.
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

To remove the ReadOnly attribute from a file, use the code below. When you start dealing with folder level security things get more complex and you need to have the appropriate permissions to modify the access control rights on a folder. My suggestion would be to start small and work your way up.

Thearon

Imports System.IO

Public Class Form1

    Private Sub btnFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFile.Click
        Dim strFile As String = "C:\Documents and Settings\Thearon\My Documents\kagi\arrow.gif"
        File.SetAttributes(strFile, FileAttributes.Normal)
    End Sub
End Class