Results 1 to 3 of 3

Thread: [RESOLVED] get WAN ip address

  1. #1

    Thread Starter
    Addicted Member cc2^^'s Avatar
    Join Date
    Apr 2008
    Location
    Right behind you.
    Posts
    165

    Resolved [RESOLVED] get WAN ip address

    I have seen how to get LAN ip address but not routers ip. Does anybody know how to?
    I think I am, therefore, I am. I think.

  2. #2
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: get WAN ip address

    Is this what you want?

    vb Code:
    1. Option Explicit
    2.  
    3. Private Declare Function URLDownloadToFile Lib "urlmon" _
    4. Alias "URLDownloadToFileA" (ByVal pCaller As Long, _
    5. ByVal szURL As String, ByVal szFileName As String, _
    6. ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
    7.  
    8. Private Sub Command1_Click()
    9.     Dim cTemp As String, pos1 As Long
    10.     Call URLDownloadToFile(0, "http://www.whatismyip.com", _
    11.     App.Path & "\ipaddress.htm", 0, 0)
    12.    
    13.     If Dir(App.Path & "\ipaddress.htm") <> "" Then
    14.         cTemp = CreateObject("Scripting.FileSystemObject").OpenTextFile(App.Path _
    15.         & "\ipaddress.htm").ReadAll
    16.        
    17.         '~~> On the webpage, the IP address is stored after
    18.         '~~> "Your IP Address Is "
    19.         pos1 = InStr(1, cTemp, "Your IP Address Is ")
    20.        
    21.         '~~> Display IP Address
    22.         MsgBox Mid(cTemp, pos1 + Len("Your IP Address Is "), 15)
    23.        
    24.         Kill App.Path & "\ipaddress.htm"
    25.     Else
    26.         MsgBox "Unknown IP Address"
    27.     End If
    28. End Sub
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  3. #3

    Thread Starter
    Addicted Member cc2^^'s Avatar
    Join Date
    Apr 2008
    Location
    Right behind you.
    Posts
    165

    Re: [RESOLVED] get WAN ip address

    Yes that's what i want. Thanks alot
    I think I am, therefore, I am. I think.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width