I have seen how to get LAN ip address but not routers ip. Does anybody know how to?
Printable View
I have seen how to get LAN ip address but not routers ip. Does anybody know how to?
Is this what you want?
vb Code:
Option Explicit Private Declare Function URLDownloadToFile Lib "urlmon" _ Alias "URLDownloadToFileA" (ByVal pCaller As Long, _ ByVal szURL As String, ByVal szFileName As String, _ ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long Private Sub Command1_Click() Dim cTemp As String, pos1 As Long Call URLDownloadToFile(0, "http://www.whatismyip.com", _ App.Path & "\ipaddress.htm", 0, 0) If Dir(App.Path & "\ipaddress.htm") <> "" Then cTemp = CreateObject("Scripting.FileSystemObject").OpenTextFile(App.Path _ & "\ipaddress.htm").ReadAll '~~> On the webpage, the IP address is stored after '~~> "Your IP Address Is " pos1 = InStr(1, cTemp, "Your IP Address Is ") '~~> Display IP Address MsgBox Mid(cTemp, pos1 + Len("Your IP Address Is "), 15) Kill App.Path & "\ipaddress.htm" Else MsgBox "Unknown IP Address" End If End Sub
Yes that's what i want. Thanks alot :D