Pregunta: | 60816 - IP DE LA MAQUINA |
Autor: | Ronald Lopez Conrado |
Hola estoy haciendo un sistemita y necesito una Funcion o algun codigo para obtener la direccion IP de la Maquina en la q se ejecuta el programa asi como tambien el DNS De la maquina |
Respuesta: | Leonardo Alfaro A. |
'--- En Vb.net
Private Sub MostrarDatosPC() Dim strNombrePC As String strNombrePC = System.Net.Dns.GetHostName() Dim h As System.Net.IPHostEntry = System.Net.Dns.GetHostByName(System.Net.Dns.GetHostName) Dim strLocalIp As String = h.AddressList.GetValue(0).ToString MsgBox("Nombre del pc: " & strNombrePC & "; Direccion IP: " & strLocalIp) End Sub |