First add 2 textbox
textbox1 over textbox2
go on properties of textbox2 and set readonly to true
and a button.. name it get or get ip
your choice
now paste the following codes
Code:
textbox1 over textbox2
go on properties of textbox2 and set readonly to true
and a button.. name it get or get ip
your choice
now paste the following codes
Code:
Code:
Imports System.Net
Public Class Form3
Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
Try
If TextBox1.Text.Contains("http://") Then
Dim iphe As IPHostEntry = Dns.GetHostEntry(TextBox1.Text.Replace("http://", String.Empty))
TextBox2.Text = iphe.AddressList(0).ToString()
Else
Dim iphe As IPHostEntry = Dns.GetHostEntry(TextBox1.Text)
TextBox2.Text = iphe.AddressList(0).ToString()
End If
Catch ex As Exception
MsgBox(ex)
End Try
End Sub
End Class
0 comments:
Post a Comment