[code] Get your real IP-address

Discussion in 'Programming General' started by rofloller, Oct 7, 2008.

[code] Get your real IP-address
  1. Unread #1 - Oct 7, 2008 at 3:35 AM
  2. rofloller
    Referrals:
    0

    rofloller Guest

    [code] Get your real IP-address

    VB6: Get your real IP-address

    You need to enable Microsoft Internet Controls from Project -> Components... and add Inet control to your form and rename it to Inet instead of Inet1.

    Code:
    Private Sub Form_Load()
    MsgBox RealIP
    End Sub
    
    Private Function RealIP()
    On Error GoTo err
    
    Dim before As String
    Dim sitehtml As String
    Dim myIP As String
    Dim after As String
    
    sitehtml = Inet.OpenURL("http://www.ip-adress.com/")
    While Inet.StillExecuting
    DoEvents
    Wend
    
    DivideText sitehtml, "My IP address: ", "</span></b></font></span>", before, myIP, after
    RealIP = myIP
    
    Exit Function
    err:
    RealIP = "ERROR: " & Error
    End Function
    
    Private Sub DivideText(ByVal txt As String, _
    ByVal target1 As String, ByVal target2 As String, _
    ByRef before As String, ByRef between As String, _
    ByRef after As String)
    Dim pos As Long
    
    ' Get the text before target1.
    pos = InStr(txt, target1)
    If pos = 0 Then
    ' target1 is missing. Set before = "".
    before = ""
    Else
    ' Set before.
    before = Left$(txt, pos - 1)
    ' Remove up to target1 from the string.
    txt = Mid$(txt, pos + Len(target1))
    End If
    
    ' Get the text before target2.
    pos = InStr(txt, target2)
    If pos = 0 Then
    ' target2 is missing. Set between = "".
    between = ""
    Else
    ' Set between.
    between = Left$(txt, pos - 1)
    ' Remove up to target2 from the string.
    txt = Mid$(txt, pos + Len(target2))
    End If
    
    after = txt
    End Sub
     
  3. Unread #2 - Oct 7, 2008 at 7:57 AM
  4. jdsfighter
    Joined:
    Jan 21, 2007
    Posts:
    603
    Referrals:
    0
    Sythe Gold:
    0

    jdsfighter Forum Addict
    Visual Basic Programmers

    [code] Get your real IP-address

    or much easier...

    Code:
    Msgbox Inet1.OpenUrl("http://pspools.net/jdh/ip.asp")
     
  5. Unread #3 - Oct 7, 2008 at 10:17 AM
  6. rofloller
    Referrals:
    0

    rofloller Guest

    [code] Get your real IP-address

    Damn.. :D I didn't know that address.
     
  7. Unread #4 - Oct 7, 2008 at 10:29 AM
  8. Nullware
    Joined:
    Jan 30, 2007
    Posts:
    1,761
    Referrals:
    4
    Sythe Gold:
    0

    Nullware Guru

    [code] Get your real IP-address

    Or just make your own web page that does the same thing in about 2 seconds.:p
     
  9. Unread #5 - Oct 7, 2008 at 4:18 PM
  10. hampe-92
    Joined:
    Jul 10, 2008
    Posts:
    328
    Referrals:
    0
    Sythe Gold:
    0

    hampe-92 Forum Addict

    [code] Get your real IP-address

  11. Unread #6 - Oct 7, 2008 at 5:31 PM
  12. jdsfighter
    Joined:
    Jan 21, 2007
    Posts:
    603
    Referrals:
    0
    Sythe Gold:
    0

    jdsfighter Forum Addict
    Visual Basic Programmers

    [code] Get your real IP-address

    Of course you didn't, that is my own personal site ;)
     
  13. Unread #7 - Oct 8, 2008 at 12:33 AM
  14. demonavenger
    Joined:
    Feb 25, 2007
    Posts:
    536
    Referrals:
    0
    Sythe Gold:
    0

    demonavenger Forum Addict
    $5 USD Donor

    [code] Get your real IP-address

    What about
    Code:
    shell ipconfig
    
    or something under those lines, lol!
     
  15. Unread #8 - Oct 8, 2008 at 2:06 AM
  16. rofloller
    Referrals:
    0

    rofloller Guest

    [code] Get your real IP-address

    Yes? That shows ipconfig until it completes it. You need to add pause. And what the hell you do with that if you need to know your ip in your program?
    If you want just to know it goto www.whatismyip.com


    BTW ipconfig doesn't some times show your real IP.... Thats why this is "REAL IP"
     
  17. Unread #9 - Oct 8, 2008 at 4:25 PM
  18. jdsfighter
    Joined:
    Jan 21, 2007
    Posts:
    603
    Referrals:
    0
    Sythe Gold:
    0

    jdsfighter Forum Addict
    Visual Basic Programmers

    [code] Get your real IP-address

    If you want to get technical, ipconfig shows your "real" ip address, but it is displaying your internal one, or rather the one that is displayed on your network, but when connecting to sites it shows the IP for your internet connection itself, your external.
     
  19. Unread #10 - Oct 9, 2008 at 7:03 PM
  20. Blupig
    Joined:
    Nov 23, 2006
    Posts:
    7,145
    Referrals:
    16
    Sythe Gold:
    1,609
    Discord Unique ID:
    178533992981594112
    Valentine's Singing Competition Winner Member of the Month Winner MushyMuncher Gohan has AIDS Extreme Homosex World War 3 I'm LAAAAAAAME
    Off Topic Participant

    Blupig BEEF TOILET
    $5 USD Donor

    [code] Get your real IP-address

    This code is kind of pointless...Just gathers data from a webpage. It would be more interesting if you got it using a control of some sort. I never really though of trying this out...
     
  21. Unread #11 - Oct 9, 2008 at 9:53 PM
  22. demonavenger
    Joined:
    Feb 25, 2007
    Posts:
    536
    Referrals:
    0
    Sythe Gold:
    0

    demonavenger Forum Addict
    $5 USD Donor

    [code] Get your real IP-address

    ^ LoL Fail. ^_^
     
  23. Unread #12 - Oct 9, 2008 at 10:52 PM
  24. jdsfighter
    Joined:
    Jan 21, 2007
    Posts:
    603
    Referrals:
    0
    Sythe Gold:
    0

    jdsfighter Forum Addict
    Visual Basic Programmers

    [code] Get your real IP-address

    Also by doing something like this:

    Code:
    shell "cmd /c ipconfig /all>c:\Test.txt"
    You can save the output of the ipconfig command.
     
  25. Unread #13 - Oct 10, 2008 at 8:22 AM
  26. rofloller
    Referrals:
    0

    rofloller Guest

    [code] Get your real IP-address

    I know... This is for getting the IP you use in network.
     
< (Guide) Hot to create an undetectable Auto Talker | [Source] Simple module for games that require buying an item >

Users viewing this thread
1 guest


 
 
Adblock breaks this site