How to know if devices is connected to network?

Hey, any blueprints with your C++ code “Internet Check Connection” ? I really need some help.