|
 |
|
C# winApp การ list รายชื่อไฟล์ที่มีจำนวนมากๆ |
|
 |
|
|
 |
 |
|
.NET เร็วสุดเท่านั้นแล...ง่ายแต่ช้า คือ ฉายา
อันล่างนี้ยังเร็วกว่าอีก 
Code (C++17)
#include <string>
#include <iostream>
#include <filesystem>
namespace fs = std::filesystem;
int main()
{
std::string path = "/path/to/directory";
for (const auto & entry : fs::directory_iterator(path))
std::cout << entry.path() << std::endl;
}
ถ้าอยากใช้ใน .Net ก็ compile เป็น dll
แล้วทำเป็น Wrapper ด้วย P/Invoke
...เทคนิคโบราณ แต่เร็วถึงใจชัวร์
หรือ ใช้ของที่มีคนทำไว้แล้ว
http://help.csharptest.net/?CSharpTest.Net.Library~CSharpTest.Net.IO_namespace.html
iterate ด้วย FindFile class
|
 |
 |
 |
 |
Date :
2023-04-04 10:38:50 |
By :
009 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|