|
![](/images/resource/spacer.gif) |
|
C# winApp การ list รายชื่อไฟล์ที่มีจำนวนมากๆ |
|
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
.NET เร็วสุดเท่านั้นแล...ง่ายแต่ช้า คือ ฉายา
อันล่างนี้ยังเร็วกว่าอีก ![](/images/bbcode/lol.gif?v=1001)
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
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2023-04-04 10:38:50 |
By :
009 |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
|
|
|
![](/images/digitalocean-banner.jpg)
|
Load balance : Server 00
|