Results 1 to 3 of 3

Thread: How to set a file to be read only?

  1. #1

    Thread Starter
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464

    How to set a file to be read only?

    This is probably simple, but a quick search didn't produce anything.

    How do I programmatically set a file to be read only?

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    I think this would do:
    VB Code:
    1. Dim fi As New FileInfo("C:\test.jpg")
    2.         fi.Attributes = FileAttributes.ReadOnly Or fi.Attributes
    didnt test it, but I think that's how it should be
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  3. #3

    Thread Starter
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Yep, I figured that out after I posted, but didn't have the time to come back and tell anyone. Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width