Killsoft Sugdok


Join the forum, it's quick and easy

Killsoft Sugdok
Killsoft Sugdok
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Check your internal & external ip

Go down

Check your internal & external ip Empty Check your internal & external ip

Post by giovhz Thu Nov 07, 2013 6:05 pm

23:30:29 11.07.2013

Imports System.Net.WebClient
Imports System.Text.RegularExpressions
Public Class Form1
    Dim webip As New Net.WebClient
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Try
            ipAddresses.Text = "checking your ip wait few second..."
            Button1.Enabled = False
        Catch

        End Try

        Dim externalIP As String = Nothing
        Try
            externalIP = webip.DownloadString("http://checkip.dyndns.org/")
            externalIP = New Regex("\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}").Matches(externalIP)(0).ToString
            ipAddresses.Text = ("Internal IP: " _
        & (System.Net.Dns.GetHostByName(System.Net.Dns.GetHostName).AddressList(0).ToString _
           & vbNewLine & (" External IP: " + externalIP)))
            Button1.Enabled = True
        Catch
            ipAddresses.Text = "error! check your internet connection..."
            Button1.Enabled = True
        End Try

        '("Internal IP: " _
        ' + (System.Net.Dns.GetHostByName(System.Net.Dns.GetHostName).AddressList(0).ToString _
        '+ (externalIP Is Nothing)))
        'TODO: Warning!!!, inline IF is not supported ?
        'Warning!!! Lambda constructs are not supported
    End Sub
End Class
giovhz
giovhz
Newbie
Newbie

Posts : 41
Join date : 2013-03-09

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum