Visual Basic ip adresi öğrenme
1 2 |
Imports System.Net Imports System.Text.RegularExpressions |
kütüphaneye ekliyoruz
1 2 3 4 5 6 7 |
Private Function GetIP() As String Dim wc As New WebClient() Dim strIP As String = wc.DownloadString("http://checkip.dyndns.org") strIP = (New Regex("\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b")).Match(strIP).Value wc.Dispose() Return strIP End Function |
1 |
Buton click olayına şu kodları girelim: |
1 |
Label1.Text = (GetIP()) |
Leave a reply