• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 284
  • Last Modified:

VS C# file and directory question

I have created a VS 2008 C# program that creates a series of CSV files and then emails them. The CSV files are written to a folder and each month they get overwritten. Now they want me to archive these files each month and make the output files read-only.

So I have several questions:
1) What function do I use to create a new folder?
2) What function do I use to move these files to this new folder?
3) What function do I use to delete these files from the original folder?
4) What function do I use to change the file attribute to read-only?
0
rwheeler23
Asked:
rwheeler23
1 Solution
 
käµfm³d 👽Commented:
1) System.IO.Directory.CreateDirectory
2) System.IO.File.Move
3) System.IO.File.Delete (but Move should "erase" the original once it has been moved to the destination directory)
4) System.IO.File.SetAttributes, using the FileAttributes.ReadOnly flag.
0
 
rwheeler23Author Commented:
Thank you.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now