File Write protect

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jamesd0142
    Contributor
    • Sep 2007
    • 471

    File Write protect

    vb.net (vb2005)

    Does anyone know how to change the write protect property of a file through code?

    is this possible?

    James
  • shweta123
    Recognized Expert Contributor
    • Nov 2006
    • 692

    #2
    Hi,

    You can try this code :

    Code:
           ''''''''This is path to your write protected file
    
           Dim filePath = "........"
    
           '''Remove ReadOnly file attribute
           System.IO.File.SetAttributes(filePath, IO.FileAttributes.Normal)

    Originally posted by jamesd0142
    vb.net (vb2005)

    Does anyone know how to change the write protect property of a file through code?

    is this possible?

    James

    Comment

    • jamesd0142
      Contributor
      • Sep 2007
      • 471

      #3
      Originally posted by shweta123
      Hi,

      You can try this code :

      Code:
             ''''''''This is path to your write protected file
      
             Dim filePath = "........"
      
             '''Remove ReadOnly file attribute
             System.IO.File.SetAttributes(filePath, IO.FileAttributes.Normal)

      Genius, cheers

      James

      Comment

      Working...