How to get the hardware information? use what API?

.

Maybe try the SystemInfo class: