01.
private
void
Form1_Load(
object
sender, EventArgs e)
02.
{
03.
string
path = @
"C:\1\2\3\4\5"
;
04.
CreatePath(path);
05.
System.IO.DirectoryInfo di =
new
System.IO.DirectoryInfo(@
"D:\1311"
);
06.
di.GetFiles(
"*.*"
)
07.
.ToList()
08.
.ForEach(f =>
09.
{
10.
f.CopyTo(System.IO.Path.Combine(path, f.Name));
11.
});
12.
string
_path = @
"C:\5\1"
;
13.
CreatePath(_path);
14.
System.IO.DirectoryInfo _di =
new
System.IO.DirectoryInfo(path);
15.
_di.MoveTo(_path);
16.
}
17.
void
CreatePath(
string
_path)
18.
{
19.
if
(!(System.IO.Directory.Exists(_path)))
20.
{
21.
System.Diagnostics.Process.Start(
"cmd.exe"
,
"/c md "
+ Convert.ToChar(34) + _path + Convert.ToChar(34));
22.
}
23.
}