First, make the form as shown below
The Code Below
Imports System.Net Imports System.IO Public Class Form3 Dim ip, host As String Sub CariHost_IP() host = Dns.GetHostName() ip = Dns.GetHostEntry(Dns.GetHostName()).AddressList.Where(Function(a As IPAddress) Not a.IsIPv6LinkLocal AndAlso Not a.IsIPv6Multicast AndAlso Not a.IsIPv6SiteLocal).First().ToString() End Sub Private Sub btnCari_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCari.Click CariHost_IP() Label3.Text = host Label4.Text = ip End Sub End Classresult
0 komentar :
Posting Komentar