visual studio - How to check IP Address changes in VB.NET? -


how detect live ip changes?

example:

my ip without vpn: 3.3.3.3, whenever connect vpn ip changes 5.5.5.5. question is: how detect ip has changed when form running?

i have tried:

private sub timer4_tick(sender object, e eventargs) handles timer4.tick     dim adapters networkinterface() = networkinterface.getallnetworkinterfaces()     addhandler networkchange.networkaddresschanged, addressof downloadip     dim n networkinterface     each n in adapters         timer4.stop()         msgbox("ip changed")               next n end sub 

try checking ip on external website

for example:

    public sub getexternalip()             try                     dim withevents ipbrowser new webbrowser                     ipbrowser.visible = false                     me.controls.add(ipbrowser)                     ipbrowser.navigate("http://seemyip.com/onyoursite.php")             catch                 label2.text = "failed external ip"             end try     end sub         'then, put onnavigatingevent         if ipbrowser.document.all("ip").getattribute("value") isnot nothing              myextip = ipbrowser.document.all("ip").getattribute("value")         else              messagebox.show("can't find ip")         end if 

Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -