 |
|
อยากได้ Code copy เฉพาะรูป .jpg ใน Folder ต้นทาง(มี Folder ซ้อนย่อยอีก) ให้รวมกันมาอยู่ใน Folder เดียว(ปลางทาง) |
|
 |
|
|
 |
 |
|
Code (C#)
System.IO.Directory.GetFiles("path...", "*.jpg", System.IO.SearchOption.AllDirectories)
.ToList<string>()
.ForEach(file =>
{
System.IO.File.Move(file, "to file...");
});
ปล. อย่างลืม เขียนเช็คไฟล์ซ้ำด้วยครับ
|
 |
 |
 |
 |
Date :
2016-12-24 10:01:10 |
By :
lamaka.tor |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผมแปลงเป็น VB มัน Error ตรง System.IO.File.Move(file, "*.jpg")
Code (VB.NET)
System.IO.Directory.GetFiles("D:\Picture\บ้านไอเดีย", "*.jpg", System.IO.SearchOption.AllDirectories).ToList().ForEach(Function(file)
System.IO.File.Move(file, "*.jpg")
Return 1
End Function)
|
ประวัติการแก้ไข 2016-12-24 11:29:51
 |
 |
 |
 |
Date :
2016-12-24 11:29:23 |
By :
TheCom |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อ่านเรื่อง System.IO.File.Move ดูครับ
|
 |
 |
 |
 |
Date :
2016-12-24 11:38:20 |
By :
lamaka.tor |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|