简体   繁体   中英

Folder/File Renaming

I'm trying to come up with a program that helps me manage my tv show downloads.

I have a tv show folder with a bunch of sub folders that contain the tv show files. I would like to be able to recursively search each folder for the largest file, rename that file to the folder name it was contained in, put that file in the tv show folder and then delete the folder. If the folder is nested, I want the name of the top most folder.

Where can I find some documentation on how to do this?

Your task seems pretty straightforward - look at the MSDN docs for the DirectoryInfo and FileInfo classes; that should point you in the right direction.

In addition to Ben's response on taking a look at the DirectoryInfo and FileInfo classes I would also suggest that you take a look into writing a recursive algorithm. Once you know how to write a recursive algorithm and use the classes suggested by Ben you should be able to accomplish your requirement with no problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM