Hi there;
i need a code that tests if an internet connection is active via Modem or Network!!! in VB .net
any ideas?
Thank you
Printable View
Hi there;
i need a code that tests if an internet connection is active via Modem or Network!!! in VB .net
any ideas?
Thank you
See if this would help : http://www.vb2themax.com/Item.asp?Pa...at=1701&ID=588
That code assumes that you have WMI installed on the computer. WMI is not installed by default on Windows 98, so that code would fail on Windows98.Quote:
Originally posted by Pirate
See if this would help : http://www.vb2themax.com/Item.asp?Pa...at=1701&ID=588
Try this
VB Code:
Public Shared Function GotInternet() As Boolean Dim req As HttpWebRequest Dim res As HttpWebResponse Try req = CType(WebRequest.Create("http://www.devbuzz.com"), HttpWebRequest) res = CType(req.GetResponse(), HttpWebResponse) req.Abort() If res.StatusCode = HttpStatusCode.OK Then GotInternet = True End If Catch weberrt As WebException GotInternet = False Catch except As Exception GotInternet = False End Try End Function