开发者

accessing files in a particular folder in a window application

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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜