how to display an IP via PhP page. menu

User Tag List

Results 1 to 6 of 6
  1. #1
    JoeBiden's Avatar Contributor
    Reputation
    153
    Join Date
    Aug 2007
    Posts
    498
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to display an IP via PhP page.

    This is the simple way of checking your IP via a PhP webpage.


    Code:
    Using wc As New Net.WebClient()
                Dim url As String = "http://www.whatsmyip.us/showip.php"
                Dim src As String = wc.DownloadString(url)
                Dim myPublicIP As String = "Can't get it :("
                Dim pattern As String = "\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}"
                Dim myIP As System.Text.RegularExpressions.Match = System.Text.RegularExpressions.Regex.Match(src, pattern)
                If myIP IsNot Nothing Then
                    myPublicIP = myIP.Value
                End If
                MessageBox.Show(myPublicIP)
            End Using
    Enjoy

    how to display an IP via PhP page.
  2. #2
    maclone's Avatar / Authenticator enabled
    Reputation
    2420
    Join Date
    Nov 2007
    Posts
    8,726
    Thanks G/R
    0/1029
    Trade Feedback
    0 (0%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Code:
    Dim _eWebClient As New System.Net.WebClient
    Dim IPResult
    IPResult = System.Text.Encoding.ASCII.GetString((_eWebClient.DownloadData("http://whatismyip.com/automation/n09230945.asp")))
    MsgBox(IPResult)
    Zomfg. And no, don't ask. - Dombo did it.

  3. #3
    JoeBiden's Avatar Contributor
    Reputation
    153
    Join Date
    Aug 2007
    Posts
    498
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Same thing same code, diferent way of putting it..?
    Last edited by JoeBiden; 03-13-2009 at 11:28 AM.

  4. #4
    Apoc's Avatar Angry Penguin
    Reputation
    1387
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/12
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not quite. His doesn't involve regex.

    Also, use webClient.DownloadString, not DownloadData.

  5. #5
    maclone's Avatar / Authenticator enabled
    Reputation
    2420
    Join Date
    Nov 2007
    Posts
    8,726
    Thanks G/R
    0/1029
    Trade Feedback
    0 (0%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Apoc View Post
    Not quite. His doesn't involve regex.
    Also, use webClient.DownloadString, not DownloadData.
    I can't use DownloadString, it gives me an error. I can't paste it cause it's in german.
    It's something with "string" can't be converted to "1-dimensional array of byte".

    Meh, cba to fix, it just works and all good.
    Last edited by maclone; 03-15-2009 at 08:26 AM.
    Zomfg. And no, don't ask. - Dombo did it.

  6. #6
    j00nas's Avatar Member
    Reputation
    10
    Join Date
    Dec 2007
    Posts
    29
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by maclone View Post
    I can't use DownloadString, it gives me an error. I can't paste it cause it's in german.
    It's something with "string" can't be converted to "1-dimensional array of byte".

    Meh, cba to fix, it just works and all good.
    Code:
            Dim _eWebClient As New System.Net.WebClient
            Dim IPResult
            IPResult = _eWebClient.DownloadString("http://whatismyip.com/automation/n09230945.asp")
            MsgBox(IPResult)
    This seems to be working aswell.

Similar Threads

  1. [Q] How to open a chest via memory editing
    By Shoruun in forum Diablo 3 Bots Questions & Requests
    Replies: 4
    Last Post: 07-09-2012, 01:30 PM
  2. How do i make an account creation page (Trinity core)
    By ashter247 in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 09-14-2010, 11:45 PM
  3. how to display ore and herbs at the sam time
    By sytry in forum World of Warcraft Guides
    Replies: 12
    Last Post: 08-04-2009, 12:02 AM
  4. [Guide] How to easily set up a signup page. [Pics!]
    By chanceless in forum WoW EMU Guides & Tutorials
    Replies: 15
    Last Post: 09-15-2008, 04:17 PM
  5. How would I make a server status page? (Online player list, online/offline, etc.)
    By pioneer1337 in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 07-29-2008, 08:35 AM
All times are GMT -5. The time now is 03:06 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search