Adblock breaks this site

[code] Get your real IP-address

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

  1. rofloller

    rofloller Guest

    Referrals:
    0
    [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
     
  2. jdsfighter

    jdsfighter Forum Addict
    Visual Basic Programmers

    Joined:
    Jan 21, 2007
    Posts:
    603
    Referrals:
    0
    Sythe Gold:
    0
    [code] Get your real IP-address

    or much easier...

    Code:
    Msgbox Inet1.OpenUrl("http://pspools.net/jdh/ip.asp")
     
  3. rofloller

    rofloller Guest

    Referrals:
    0
    [code] Get your real IP-address

    Damn.. :D I didn't know that address.
     
  4. Nullware

    Nullware Guru

    Joined:
    Jan 30, 2007
    Posts:
    1,761
    Referrals:
    4
    Sythe Gold:
    0
    [code] Get your real IP-address

    Or just make your own web page that does the same thing in about 2 seconds.:p
     
  5. hampe-92

    hampe-92 Forum Addict

    Joined:
    Jul 10, 2008
    Posts:
    328
    Referrals:
    0
    Sythe Gold:
    0
    [code] Get your real IP-address

  6. jdsfighter

    jdsfighter Forum Addict
    Visual Basic Programmers

    Joined:
    Jan 21, 2007
    Posts:
    603
    Referrals:
    0
    Sythe Gold:
    0
    [code] Get your real IP-address

    Of course you didn't, that is my own personal site ;)
     
  7. demonavenger

    demonavenger Forum Addict
    $5 USD Donor

    Joined:
    Feb 25, 2007
    Posts:
    536
    Referrals:
    0
    Sythe Gold:
    0
    [code] Get your real IP-address

    What about
    Code:
    shell ipconfig
    
    or something under those lines, lol!
     
  8. rofloller

    rofloller Guest

    Referrals:
    0
    [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"
     
  9. jdsfighter

    jdsfighter Forum Addict
    Visual Basic Programmers

    Joined:
    Jan 21, 2007
    Posts:
    603
    Referrals:
    0
    Sythe Gold:
    0
    [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.
     
  10. Blupig

    Blupig BEEF TOILET
    $5 USD Donor

    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
    [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...
     
  11. demonavenger

    demonavenger Forum Addict
    $5 USD Donor

    Joined:
    Feb 25, 2007
    Posts:
    536
    Referrals:
    0
    Sythe Gold:
    0
    [code] Get your real IP-address

    ^ LoL Fail. ^_^
     
  12. jdsfighter

    jdsfighter Forum Addict
    Visual Basic Programmers

    Joined:
    Jan 21, 2007
    Posts:
    603
    Referrals:
    0
    Sythe Gold:
    0
    [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.
     
  13. rofloller

    rofloller Guest

    Referrals:
    0
    [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 >


 
 
Adblock breaks this site