Setting File Attributes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How does one programmatically set attributes when looking through a directory? The code example in VS2003 shows how to get an attribute(Hidden), but doesn't show how to set one (ReadOnly).
 
Michael,

The DirectoryInfo and FileInfo classes have an Attributes property that
you can set to be the attributes you want the file or directory to have.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

MichaelW said:
How does one programmatically set attributes when looking through a
directory? The code example in VS2003 shows how to get an
attribute(Hidden), but doesn't show how to set one (ReadOnly).
 
I'll give this a shot. I am taking a C# class and we've just started
working with the directory/file objects. I will pass this on to my
instructor.
thanks for your time...
 
Back
Top