{"id":4088,"date":"2014-03-30T07:40:34","date_gmt":"2014-03-30T07:40:34","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/to-check-for-internet-connection-in-vc-net-collection-of-common-programming-errors\/"},"modified":"2014-03-30T07:40:34","modified_gmt":"2014-03-30T07:40:34","slug":"to-check-for-internet-connection-in-vc-net-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/to-check-for-internet-connection-in-vc-net-collection-of-common-programming-errors\/","title":{"rendered":"to check for Internet connection in vc++.net-Collection of common programming errors"},"content":{"rendered":"<p>You can use\u00a0InternetGetConnectedState<\/p>\n<pre>using namespace System::Runtime::InteropServices; ... [DllImport(\"wininet.dll\")]\nstatic bool InternetGetConnectedState(int connectionDescription, int reservedValue); static bool IsConnected()\n{ int connectionDescription = 0; return InternetGetConnectedState(connectionDescription, 0);\n}\n<\/pre>\n<p>and then use IsConnected.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can use\u00a0InternetGetConnectedState using namespace System::Runtime::InteropServices; &#8230; [DllImport(&#8220;wininet.dll&#8221;)] static bool InternetGetConnectedState(int connectionDescription, int reservedValue); static bool IsConnected() { int connectionDescription = 0; return InternetGetConnectedState(connectionDescription, 0); } and then use IsConnected.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4088","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4088","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4088"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4088\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4088"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4088"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4088"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}