Results 1 to 3 of 3

Thread: [SOLVED] [2008] Ip Checker

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2008
    Posts
    84

    Talking [SOLVED] [2008] Ip Checker

    Do somone have a code:

    Button1 Click...etc..
    check ip code
    write IP in textbox 1
    Last edited by blt950; Jul 23rd, 2008 at 09:38 AM.

  2. #2
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    Re: [2008] Ip Checker

    To get the local IPs, you can do something like this:
    Code:
            Dim s As String = System.Net.Dns.GetHostName()
            Dim IPEntry As IPHostEntry = System.Net.Dns.GetHostEntry(s)
            Dim IPAdds As IPAddress() = IPEntry.AddressList
    
            For Each IPAdd As IPAddress In IPAdds
                TextBox1.Text &= IPAdd.ToString() & Environment.NewLine
    
            Next
    To get the external facing IDs, you will have to use a service out on the net. My example uses whatismyip.com, but make sure to read their automation page before you just start using their service.

    Code:
            Dim wc As New System.Net.WebClient()
            Dim enc As New System.Text.ASCIIEncoding
            TextBox1.Text = enc.GetString(wc.DownloadData("http://whatismyip.com/automation/n09230945.asp"))

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2008
    Posts
    84

    Re: [2008] Ip Checker

    Quote Originally Posted by Negative0
    To get the local IPs, you can do something like this:
    Code:
            Dim s As String = System.Net.Dns.GetHostName()
            Dim IPEntry As IPHostEntry = System.Net.Dns.GetHostEntry(s)
            Dim IPAdds As IPAddress() = IPEntry.AddressList
    
            For Each IPAdd As IPAddress In IPAdds
                TextBox1.Text &= IPAdd.ToString() & Environment.NewLine
    
            Next
    To get the external facing IDs, you will have to use a service out on the net. My example uses whatismyip.com, but make sure to read their automation page before you just start using their service.

    Code:
            Dim wc As New System.Net.WebClient()
            Dim enc As New System.Text.ASCIIEncoding
            TextBox1.Text = enc.GetString(wc.DownloadData("http://whatismyip.com/automation/n09230945.asp"))
    Thx.. It helped and works

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