via API, what's the simplest way to see if my computer is connected to the internet?

thanks

--michael