Results 1 to 6 of 6

Thread: [2005] IP Finder

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member knxrb's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Posts
    321

    [2005] IP Finder

    I've made an IP finder! I had a look on the web for 'get ip' code and I couldn't find any(that I understood); so I put some together and came up with my application

    Application:
    [Link to compiled executable removed — Mod]

    Code:
    Code:
    Imports System
    Imports System.Net.Dns
    
    Public Class Main
    
        Private Sub Main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Dim shostname As String
            shostname = System.Net.Dns.GetHostName
            Console.WriteLine("Your Machine Name = " & shostname)
            Console.WriteLine("Your IP = " & GetIPAddress())
            TextBox1.Text = shostname
            txtip.Text = "" & GetIPAddress()
    
        End Sub
        Shared Function GetIPAddress() As String
            Dim oAddr As System.Net.IPAddress
            Dim sAddr As String
            With System.Net.Dns.GetHostByName(System.Net.Dns.GetHostName())
                oAddr = New System.Net.IPAddress(.AddressList(0).Address)
                sAddr = oAddr.ToString
            End With
            GetIPAddress = sAddr
        End Function
    
    End Class
    Last edited by penagate; Sep 14th, 2007 at 02:17 PM.

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