使用C#(Windows控制台应用程序)创建多个文件夹并将文件移入其中。 [英] Create multiple folders and move files into it using C# (Windows Console app).
问题描述
我在C:\ Temp \ test目录中有多个文件。
ex。
- 0001.aux
- 0001.aux.xml
- 0001.jgw
- 0001.jpg
- 0002.aux
- 0002.aux.xml
- 0002.jgw
- 0002.jpg
- 0003.aux
- 0003.aux.xml
- 0003.jgw
- 0003.jpg
- 0004.aux
- 0004.aux.xml
- 0004.jgw
- 0004.jpg
我想创建多个文件夹AA和BB,CC,并将具有相同名称的文件的特定号码移入其中。
C:\ Temp\test\AA
- 0001.aux
- 0001.aux.xml
- 0001.jgw
- 0001.jpg
- 0002.aux
- 0002.aux.xml
- 0002.jgw
- 0002.jpg
C:\ Temp\test\BB< br $>
- 0003.aux
- 0003.aux.xml
- 0003.jgw
- 0003.jpg < br $>
- 0004.aux
- 0004.aux.xml
- 0004.jgw
- 0004.jpg
请教我如何创建多个文件夹并使用C#(Windows控制台应用程序)将文件移入其中。
查看 DirectoryInfo
类 [ ^ ]。
Hi,
I have multiple files in "C:\Temp\test" directory.
ex.
- 0001.aux
- 0001.aux.xml
- 0001.jgw
- 0001.jpg
- 0002.aux
- 0002.aux.xml
- 0002.jgw
- 0002.jpg
- 0003.aux
- 0003.aux.xml
- 0003.jgw
- 0003.jpg
- 0004.aux
- 0004.aux.xml
- 0004.jgw
- 0004.jpg
I would like to create multiple folders as "AA" and "BB", "CC" and move specific number of the file with the same name into them.
"C:\Temp\test\AA"
- 0001.aux
- 0001.aux.xml
- 0001.jgw
- 0001.jpg
- 0002.aux
- 0002.aux.xml
- 0002.jgw
- 0002.jpg
"C:\Temp\test\BB"
- 0003.aux
- 0003.aux.xml
- 0003.jgw
- 0003.jpg
- 0004.aux
- 0004.aux.xml
- 0004.jgw
- 0004.jpg
Please teach me how to create multiple folders and move files into it using C# (Windows Console app).
See the DirectoryInfo
Class[^].
这篇关于使用C#(Windows控制台应用程序)创建多个文件夹并将文件移入其中。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!