tags:

views:

40

answers:

1

I want to select multiple files based on their specific contents from a particular folder and edit their contents. I am using winform in C#.

any idea which are the classes that can be used.

It would be helpful if code given for example.

thanks.

+2  A: 

Hi,

have a look at Directory.GetFiles to get to the names of the files in a directory. If they're text files you can read them via File.ReadAllLines (returnsan array of strings, one per line of the file) or File.ReadAllText (returns a single string containing the entire content of the file).

To save the edited files have a look at File.WriteAllLines or File.WriteAllText.

andyp
I want to use folder not a directory.please help on that.
Ankita_K
As far as I know a folder **is** a directory, the words are just synonyms.
andyp