Solved

VS C# file and directory question

Posted on 2012-04-01
2
228 Views
Last Modified: 2012-04-01
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
Comment
Question by:rwheeler23
2 Comments
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 37793056
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
 

Author Closing Comment

by:rwheeler23
ID: 37793792
Thank you.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now